[LLDB] Show sub type of signals when debugging a core file
authorDavid Spickett <david.spickett@linaro.org>
Tue, 14 Mar 2023 11:52:48 +0000 (11:52 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Tue, 21 Mar 2023 09:10:09 +0000 (09:10 +0000)
commit85bc498826d4dac4b64f7b02659f6ec52f11c223
tree64e9a59a365953a82230739c4e43610262ec2cd7
parentd0de2c51c9a9fc0fedb97ee98f61ce08cb34972b
[LLDB] Show sub type of signals when debugging a core file

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.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D146045
lldb/include/lldb/Target/StopInfo.h
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
lldb/source/Target/StopInfo.cpp
lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py
llvm/docs/ReleaseNotes.rst