[Lldb-commits] [lldb] [lldb] Fix source line annotations for libsanitizers traces (PR #154247)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 20 00:56:11 PDT 2025


================
@@ -248,6 +248,22 @@ enum class IterationAction {
   Stop,
 };
 
+/// Specifies the type of PCs when creating a `HistoryThread`.
+/// - Usually, when LLDB unwinds the stack or we retrieve a stack trace via
+///   `backtrace()` we are collecting return addresses (except for the topmost
+///   frame which is the actual PC).  LLDB then maps these return addresses back
+///   to call addresses to give accurate source line annotations.
+/// - Some trace providers (e.g., ASan compiler-rt runtime) already perform this
+///   mapping, so we need to prevent LLDB from doing it again.
+/// - Other trace providers (e.g., libsanitizers traces) collect return
+///   addresses but prune the topmost frames, so we should skip the special
+///   treatment of frame 0.
+enum class TracePCType {
----------------
Michael137 wrote:

Wonder if `TracePCType` name is the most appropriate name. `Trace` has become quite the overloaded term inside LLDB. So `BacktracePCType`? Or just `PCType`? Any thoughts @JDevlieghere 

https://github.com/llvm/llvm-project/pull/154247


More information about the lldb-commits mailing list