Skip to content

Commit ae573f7

Browse files
committed
[LLDB] ASanLibsanitizers Use sanitizers_address_on_report breakpoint (llvm#84583)
symbol This patch puts the default breakpoint on the sanitizers_address_on_report symbol, and uses the old symbol as a backup if the default case is not found rdar://123911522
1 parent 1c41e44 commit ae573f7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lldb/source/Plugins/InstrumentationRuntime/ASanLibsanitizers/InstrumentationRuntimeASanLibsanitizers.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,16 @@ void InstrumentationRuntimeASanLibsanitizers::Activate() {
9090
if (!process_sp)
9191
return;
9292

93+
lldb::ModuleSP module_sp = GetRuntimeModuleSP();
94+
9395
Breakpoint *breakpoint = ReportRetriever::SetupBreakpoint(
94-
GetRuntimeModuleSP(), process_sp,
95-
ConstString("_Z22raise_sanitizers_error23sanitizer_error_context"));
96+
module_sp, process_sp, ConstString("sanitizers_address_on_report"));
97+
98+
if (!breakpoint) {
99+
breakpoint = ReportRetriever::SetupBreakpoint(
100+
module_sp, process_sp,
101+
ConstString("_Z22raise_sanitizers_error23sanitizer_error_context"));
102+
}
96103

97104
if (!breakpoint)
98105
return;

lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ bool ReportRetriever::NotifyBreakpointHit(ProcessSP process_sp,
219219
return true; // Return true to stop the target
220220
}
221221

222+
// FIXME: Setup the breakpoint using a less fragile SPI. rdar://124399066
222223
Breakpoint *ReportRetriever::SetupBreakpoint(ModuleSP module_sp,
223224
ProcessSP process_sp,
224225
ConstString symbol_name) {

0 commit comments

Comments
 (0)