[Lldb-commits] [lldb] [lldb/aarch64] Fix unwinding when signal interrupts a leaf function (PR #91321)
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Thu May 9 15:08:17 PDT 2024
jasonmolenda wrote:
Ah, so the problem is,
```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=1, subcode=0xdead)
* frame #0: 0x0000000100003f2c b.out`signal_generating_add + 4 at signal-in-leaf-function-aarch64.c:5
frame #1: 0x0000000100003f7c b.out`main + 44 at signal-in-leaf-function-aarch64.c:14
frame #2: 0x0000000185c76244 dyld`start + 2792
```
The bad instruction in `signal_generating_add()`, is sent to the program master a EXC_BAD_INSTRUCTION mach exception, not a posix signal (or maybe it was received by lldb as a mach exception and if it had continued to the process it would be recieved as a signal).
When I've done these kinds of test cases in the past, I usually add a signal handler and then send the signal to the inferior, e.g. `lldb/test/API/functionalities/unwind/sigtramp/main.c` -- this test is marked `@skipUnlessDarwin` with a comment of
```
# On different platforms the "_sigtramp" and "__kill" frames are likely to be different.
# This test could probably be adapted to run on linux/*bsd easily enough.
```
(the test explicitly checks the stack for the function names that should appear above the signal handler)
https://github.com/llvm/llvm-project/pull/91321
More information about the lldb-commits
mailing list