[all-commits] [llvm/llvm-project] 51480e: [lldb] Introduce HistoryPCType enum

Julian Lettner via All-commits all-commits at lists.llvm.org
Wed Aug 20 12:10:32 PDT 2025


  Branch: refs/heads/users/yln/lldb-libsanitizers-trace-accuracy
  Home:   https://github.com/llvm/llvm-project
  Commit: 51480efc86e24eb79a4d95fc79da282828aa1a5f
      https://github.com/llvm/llvm-project/commit/51480efc86e24eb79a4d95fc79da282828aa1a5f
  Author: Julian Lettner <jlettner at apple.com>
  Date:   2025-08-20 (Wed, 20 Aug 2025)

  Changed paths:
    M lldb/include/lldb/lldb-private-enumerations.h
    M lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
    M lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
    M lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
    M lldb/source/Plugins/Process/Utility/HistoryThread.cpp
    M lldb/source/Plugins/Process/Utility/HistoryThread.h
    M lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp
    M lldb/source/Plugins/Process/Utility/HistoryUnwind.h
    M lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp

  Log Message:
  -----------
  [lldb] Introduce HistoryPCType enum

Introduce and adopt `HistoryPCType` enum to replace
`pcs_are_call_addresses` bool to make handling of
history back traces more clear and allow for
extension of behavior.

This change is a mechanical refactoring and
preservers current behavior:
```
pcs_are_call_addresses:
  false  ->  HistoryPCType::Returns (default)
  true   ->  HistoryPCType::Calls
```

rdar://157596927


  Commit: d87f634771c60de23c536ac8e4eafbeef933be80
      https://github.com/llvm/llvm-project/commit/d87f634771c60de23c536ac8e4eafbeef933be80
  Author: Julian Lettner <jlettner at apple.com>
  Date:   2025-08-20 (Wed, 20 Aug 2025)

  Changed paths:
    M lldb/include/lldb/lldb-private-enumerations.h
    M lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
    M lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp
    M lldb/test/API/functionalities/asan/TestMemoryHistory.py

  Log Message:
  -----------
  [lldb] Fix source line annotations for libsanitizers

When providing allocation and deallocation traces,
the ASan compiler-rt runtime already provides call
addresses (`HistoryPCType::Calls`).

On Darwin, system sanitizers (libsanitizers)
provides return address.  It also discards a few
non-user frames at the top of the stack, because
these internal libmalloc/libsanitizers stack
frames do not provide any value when diagnosing
memory errors.

Introduce and add handling for
`HistoryPCType::ReturnsNoZerothFrame` to cover
this case and enable libsanitizers traces
line-level testing.

rdar://157596927


  Commit: 32ec4650ae0999b69ea3a0e08186bce7c090bae9
      https://github.com/llvm/llvm-project/commit/32ec4650ae0999b69ea3a0e08186bce7c090bae9
  Author: Julian Lettner <jlettner at apple.com>
  Date:   2025-08-20 (Wed, 20 Aug 2025)

  Changed paths:
    M lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp
    M lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp
    M lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.h
    M lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp

  Log Message:
  -----------
  [lldb] Refactor `GetPreferredAsanModule()` to also return the `HistoryPCType`


Compare: https://github.com/llvm/llvm-project/compare/d9157e0b3cbf...32ec4650ae09

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