[all-commits] [llvm/llvm-project] 0236cb: [lldb] Enable "frame diagnose" on linux (#123217)

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Jan 23 04:05:00 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0236cb689550ed2dac406443c652efb723cb2602
      https://github.com/llvm/llvm-project/commit/0236cb689550ed2dac406443c652efb723cb2602
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2025-01-23 (Thu, 23 Jan 2025)

  Changed paths:
    M lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
    M lldb/source/Target/UnixSignals.cpp
    M lldb/test/API/commands/frame/diagnose/array/TestArray.py
    M lldb/test/API/commands/frame/diagnose/bad-reference/TestBadReference.py
    M lldb/test/API/commands/frame/diagnose/complicated-expression/TestComplicatedExpression.py
    M lldb/test/API/commands/frame/diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
    M lldb/test/API/commands/frame/diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
    M lldb/test/API/commands/frame/diagnose/dereference-this/TestDiagnoseDereferenceThis.py
    M lldb/test/API/commands/frame/diagnose/inheritance/TestDiagnoseInheritance.py
    M lldb/test/API/commands/frame/diagnose/local-variable/TestLocalVariable.py
    M lldb/test/API/commands/frame/diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
    M lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py
    M lldb/test/API/linux/aarch64/mte_tag_faults/TestAArch64LinuxMTEMemoryTagFaults.py
    M lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py
    M lldb/test/Shell/Register/Core/x86-32-linux-multithread.test
    M lldb/test/Shell/Register/Core/x86-64-linux-multithread.test
    M lldb/unittests/Signals/UnixSignalsTest.cpp
    M llvm/docs/ReleaseNotes.md

  Log Message:
  -----------
  [lldb] Enable "frame diagnose" on linux (#123217)

.. by changing the signal stop reason format :facepalm:

The reason this did not work is because the code in
`StopInfo::GetCrashingDereference` was looking for the string "address="
to extract the address of the crash. Macos stop reason strings have the
form
```
  EXC_BAD_ACCESS (code=1, address=0xdead)
```
while on linux they look like:
```
  signal SIGSEGV: address not mapped to object (fault address: 0xdead)
```

Extracting the address from a string sounds like a bad idea, but I
suppose there's some value in using a consistent format across
platforms, so this patch changes the signal format to use the equals
sign as well. All of the diagnose tests pass except one, which appears
to fail due to something similar #115453 (disassembler reports
unrelocated call targets).

I've left the tests disabled on windows, as the stop reason reporting
code works very differently there, and I suspect it won't work out of
the box. If I'm wrong -- the XFAIL will let us know.



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