Skip to content

Commit 2e18897

Browse files
committed
[lldb][InstrumentationRuntime] Run sanitizer utility expressions as C (llvm#172019)
The utility expressions in the `InstrumentationRuntime` plugins are just plain C code, but we run them as `ObjC++`. That meant we were doing redundant work (like looking up decls in the Objective-C runtime). The sanitizer tests sporadically time out while looking up function symbols in the Objective-C runtime. This patch switches the expression language to `C`. Didn't find a great way of testing this other than looking at the expression log. rdar://165656320 (cherry picked from commit d7cbc7f)
1 parent 0918a47 commit 2e18897

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ StructuredData::ObjectSP InstrumentationRuntimeTSan::RetrieveReportData(
325325
options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
326326
options.SetPrefix(thread_sanitizer_retrieve_report_data_prefix);
327327
options.SetAutoApplyFixIts(false);
328-
options.SetLanguage(eLanguageTypeObjC_plus_plus);
328+
options.SetLanguage(eLanguageTypeC);
329329

330330
ValueObjectSP main_value;
331331
ExecutionContext exe_ctx;

lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ StructuredData::ObjectSP InstrumentationRuntimeUBSan::RetrieveReportData(
124124
options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
125125
options.SetPrefix(ub_sanitizer_retrieve_report_data_prefix);
126126
options.SetAutoApplyFixIts(false);
127-
options.SetLanguage(eLanguageTypeObjC_plus_plus);
127+
options.SetLanguage(eLanguageTypeC);
128128

129129
ValueObjectSP main_value;
130130
ExecutionContext exe_ctx;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ReportRetriever::RetrieveReportData(const ProcessSP process_sp) {
8181
options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
8282
options.SetPrefix(address_sanitizer_retrieve_report_data_prefix);
8383
options.SetAutoApplyFixIts(false);
84-
options.SetLanguage(eLanguageTypeObjC_plus_plus);
84+
options.SetLanguage(eLanguageTypeC);
8585

8686
if (auto m = GetPreferredAsanModule(process_sp->GetTarget())) {
8787
SymbolContextList sc_list;

0 commit comments

Comments
 (0)