[all-commits] [llvm/llvm-project] ff7bb1: [LLDB][ELF Core] Support all the Generic (Negative...
Jacob Lalonde via All-commits
all-commits at lists.llvm.org
Tue May 27 09:14:11 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ff7bb17c88328276323603809d5d4549ca8bd22b
https://github.com/llvm/llvm-project/commit/ff7bb17c88328276323603809d5d4549ca8bd22b
Author: Jacob Lalonde <jalalonde at fb.com>
Date: 2025-05-27 (Tue, 27 May 2025)
Changed paths:
M lldb/include/lldb/Target/Platform.h
M lldb/include/lldb/Target/UnixSignals.h
M lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
M lldb/source/Plugins/Platform/Linux/PlatformLinux.h
M lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
M lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
M lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
M lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
M lldb/source/Target/UnixSignals.cpp
M lldb/unittests/Signals/UnixSignalsTest.cpp
Log Message:
-----------
[LLDB][ELF Core] Support all the Generic (Negative) SI Codes. (#140150)
Recently, I was on an issue that generated a large number of Coredumps,
and every time in both LLDB and GDB the signal was just `SIGSEGV`.
This was frustrating because we would expect a `SIGSEGV` to have an
address, or ideally even bounds. After some digging I found the
`si_code` consistently was -6. With some help from
[@cdown](https://github.com/cdown), we found neither LLDB or GDB
supports the si_codes sent from [user
space](https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/siginfo.h#L185).
Excerpted from the sigaction man page.
```
For a regular signal, the following list shows the values which
can be placed in si_code for any signal, along with the reason
that the signal was generated.
```
For which I added all of the si_codes to every Linux signal. Now for the
Coredump that triggered this whole investigation we get the accurate and
now very informative summary.
<img width="524" alt="image"
src="https://github.com/user-attachments/assets/5149f781-ef21-4491-a077-8fac862fbc20"
/>
Additionally from @labath's suggestion to move this to platform and
leverage the existing `getSiginfo()` call on thread, we can now inspect
the siginfo struct itself via `thread siginfo`. Giving us another
towards GDB parity on elf cores.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list