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

@ -158,6 +158,60 @@
.weak \canonical
.endm
.macro beg
.cfi_startproc
.endm
.macro pro
#if defined(__x86_64__)
push %rbp
.cfi_adjust_cfa_offset 8
.cfi_rel_offset %rbp,0
mov %rsp,%rbp
.cfi_def_cfa_register %rbp
#elif defined(__aarch64__)
stp x29,x30,[sp,-16]!
mov x29,sp
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x29,0
.cfi_rel_offset x30,8
#else
#error "unsupported architecture"
#endif
.endm
.macro epi
#if defined(__x86_64__)
.cfi_def_cfa_register %rsp
leave
.cfi_adjust_cfa_offset -8
.cfi_restore %rbp
#elif defined(__aarch64__)
ldp x29,x30,[sp],#16
.cfi_adjust_cfa_offset -16
.cfi_restore x30
.cfi_restore x29
#else
#error "unsupported architecture"
#endif
.endm
.macro end
.cfi_endproc
.endm
.macro cpush reg:req
push \reg
.cfi_adjust_cfa_offset 8
.cfi_rel_offset \reg,0
.endm
.macro cpop reg:req
pop \reg
.cfi_adjust_cfa_offset -8
.cfi_restore \reg
.endm
#ifdef __aarch64__
.macro jmp dest:req
b \dest