This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Show sub type of signals when debugging a core file
ClosedPublic

Authored by DavidSpickett on Mar 14 2023, 6:37 AM.

Details

Summary

Previously we only looked at the si_signo field, so you got:

(lldb) bt
* thread #1, name = 'a.out.mte', stop reason = signal SIGSEGV
  * frame #0: 0x00000000004007f4

This patch adds si_code so we can show:

(lldb) bt
* thread #1, name = 'a.out.mte', stop reason = signal SIGSEGV: sync tag check fault
  * frame #0: 0x00000000004007f4

The order of errno and code was incorrect in ElfLinuxSigInfo::Parse.
It was the order that a "swapped" siginfo arch would use, which for Linux,
is only MIPS. We removed MIPS Linux support some time ago.

See:
https://github.com/torvalds/linux/blob/fe15c26ee26efa11741a7b632e9f23b01aca4cc6/include/uapi/asm-generic/siginfo.h#L121

A test is added using memory tagging faults. Which were the original
motivation for the changes.

Diff Detail

Event Timeline

DavidSpickett created this revision.Mar 14 2023, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2023, 6:37 AM
DavidSpickett requested review of this revision.Mar 14 2023, 6:37 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 14 2023, 6:37 AM
JDevlieghere accepted this revision.Mar 14 2023, 8:57 PM

Nice. LGTM.

This revision is now accepted and ready to land.Mar 14 2023, 8:57 PM

Update GetSignalDescription function name.

This revision was landed with ongoing or failed builds.Mar 21 2023, 2:10 AM
This revision was automatically updated to reflect the committed changes.