lldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication()
authorFred Riss <friss@apple.com>
Thu, 22 Apr 2021 18:02:45 +0000 (11:02 -0700)
committerFred Riss <friss@apple.com>
Thu, 22 Apr 2021 20:32:43 +0000 (13:32 -0700)
commit91e90cf622074633009788a220a354043a609dee
tree35470f60769b8130b2f92e519996dcdf7ab6bffe
parent18a85276426b9604a9ceca8c528b694964dd8d7c
lldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication()

A couple of our Instrumentation runtimes were gathering backtraces,
storing it in a StructuredData array and later creating a HistoryThread
using this data. By deafult HistoryThread will consider the history PCs
as return addresses and thus will substract 1 from them to go to the
call address.

This is usually correct, but it's also wasteful as when we gather the
backtraces ourselves, we have much better information to decide how
to backtrace and symbolicate. This patch uses the new
GetFrameCodeAddressForSymbolication() to gather the PCs that should
be used for symbolication and configures the HistoryThread to just
use those PCs as-is.

(The MTC plugin was actaully applying a -1 itself and then the
HistoryThread would do it again, so this actaully fixes a bug there.)

rdar://77027680

Differential Revision: https://reviews.llvm.org/D101094
lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp