signals: Implement fake_stack_pop for Linux on x86_64 and i686 (#60013)
Add fake_stack_pop implementation for Linux platforms to improve stack
unwinding in debuggers when analyzing core dumps from signals like
SIGQUIT. This provides proper DWARF Call Frame Information (CFI)
directives that help unwinders locate saved register values on the
manipulated stack.
The implementation follows the same pattern as the existing macOS
version, with fake_stack_pop now unified in signals-unix.c to support
both platforms:
- x86_64: Uses .cfi_def_cfa %rsp with offsets for %rip and %rsp
- i686: Uses .cfi_def_cfa %esp with offsets for %eip and %esp
- aarch64: Uses .cfi_def_cfa sp with offsets for lr and sp
The jl_call_in_ctx function on Linux now sets up the stack similarly to
jl_call_in_state on macOS, pushing saved register state and a return
address pointing to fake_stack_pop to enable proper unwinding.
🤖 Generated with Claude Code