Get GDB working
Some checks failed
build / matrix_on_mode () (push) Has been cancelled
build / matrix_on_mode (optlinux) (push) Has been cancelled
build / matrix_on_mode (rel) (push) Has been cancelled
build / matrix_on_mode (tiny) (push) Has been cancelled
build / matrix_on_mode (tinylinux) (push) Has been cancelled

You can now say `gdb hello.com.dbg` and it'll work perfectly.
This commit is contained in:
Justine Tunney 2025-03-30 15:25:20 -07:00
parent afc986f741
commit fbc4fcbb71
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
18 changed files with 230 additions and 67 deletions

View file

@ -30,18 +30,18 @@
// @param 8(rsp) x6 is arg
// @return tid of child on success, or -errno on error
sys_clone_linux:
beg
pro
#ifdef __x86_64__
push %rbp
mov %rsp,%rbp
push %rbx
cpush %rbx
mov %rcx,%r10
mov 16(%rbp),%rbx
mov $56,%eax // __NR_clone
syscall
test %rax,%rax
jz 2f
0: pop %rbx
pop %rbp
0: cpop %rbx
epi
ret
2: xor %ebp,%ebp // child thread
mov %rbx,%rdi // arg
@ -50,15 +50,13 @@ sys_clone_linux:
mov $60,%eax // __NR_exit(exitcode)
syscall
#elif defined(__aarch64__)
stp x29,x30,[sp,#-16]!
mov x29,sp
mov x8,x3 // swap x3 and x4
mov x3,x4 // swap x3 and x4
mov x4,x8 // swap x3 and x4
mov x8,#220 // __NR_clone
svc #0
cbz x0,2f
ldp x29,x30,[sp],#16
epi
ret
2: mov x29,#0 // wipe backtrace
mov x28,x3 // set cosmo tls
@ -69,4 +67,5 @@ sys_clone_linux:
#else
#error "unsupported architecture"
#endif
end
.endfn sys_clone_linux,globl,hidden