Improved debug info emit
This commit is contained in:
@@ -91,10 +91,10 @@ if (moduleRepository.Modules().TryGetValue("main", out var mainModule))
|
||||
.text
|
||||
.globl _start
|
||||
_start:
|
||||
mov rdi, rsp # Pass stack pointer to main (argv-like)
|
||||
mov rdi, [rsp + 8] # Pass stack pointer to main (argv-like)
|
||||
call {mainFunction.ExternSymbol}
|
||||
mov rdi, rax # Move return value into rdi
|
||||
mov rax, 60 # syscall: exit
|
||||
mov rdi, rax # Move return value into rdi
|
||||
mov rax, 60 # syscall: exit
|
||||
syscall
|
||||
|
||||
""";
|
||||
@@ -102,8 +102,9 @@ if (moduleRepository.Modules().TryGetValue("main", out var mainModule))
|
||||
var runtimePath = Path.Combine(".build", "runtime.s");
|
||||
File.WriteAllText(runtimePath, runtime);
|
||||
|
||||
using var assembleProcess = Process.Start(new ProcessStartInfo("as", ["-c", runtimePath, "-o", Path.Combine(".build", "runtime.o")]));
|
||||
using var assembleProcess = Process.Start(new ProcessStartInfo("as", ["-g", "-c", runtimePath, "-o", Path.Combine(".build", "runtime.o")]));
|
||||
if (assembleProcess == null) return 1;
|
||||
assembleProcess.WaitForExit();
|
||||
|
||||
if (assembleProcess.ExitCode != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user