Author: Michael Buch
Date: 2025-12-12T16:08:13Z
New Revision: d7cbc7f9e465344dd326eaf6e5a6cfa90285ce8e

URL: 
https://github.com/llvm/llvm-project/commit/d7cbc7f9e465344dd326eaf6e5a6cfa90285ce8e
DIFF: 
https://github.com/llvm/llvm-project/commit/d7cbc7f9e465344dd326eaf6e5a6cfa90285ce8e.diff

LOG: [lldb][InstrumentationRuntime] Run sanitizer utility expressions as C 
(#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

Added: 
    

Modified: 
    
lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
    
lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
    lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
 
b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
index 498da3ffe5a4a..7db971556a2f0 100644
--- 
a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
+++ 
b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
@@ -319,7 +319,7 @@ StructuredData::ObjectSP 
InstrumentationRuntimeTSan::RetrieveReportData(
   options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
   options.SetPrefix(thread_sanitizer_retrieve_report_data_prefix);
   options.SetAutoApplyFixIts(false);
-  options.SetLanguage(eLanguageTypeObjC_plus_plus);
+  options.SetLanguage(eLanguageTypeC);
 
   ValueObjectSP main_value;
   ExecutionContext exe_ctx;

diff  --git 
a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
 
b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
index 565fd353a98e5..1db85e6815636 100644
--- 
a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
+++ 
b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
@@ -124,7 +124,7 @@ StructuredData::ObjectSP 
InstrumentationRuntimeUBSan::RetrieveReportData(
   options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
   options.SetPrefix(ub_sanitizer_retrieve_report_data_prefix);
   options.SetAutoApplyFixIts(false);
-  options.SetLanguage(eLanguageTypeObjC_plus_plus);
+  options.SetLanguage(eLanguageTypeC);
 
   ValueObjectSP main_value;
   ExecutionContext exe_ctx;

diff  --git 
a/lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp 
b/lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp
index 3642cb18c7a97..85852ba40c61c 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp
@@ -81,7 +81,7 @@ ReportRetriever::RetrieveReportData(const ProcessSP 
process_sp) {
   options.SetTimeout(process_sp->GetUtilityExpressionTimeout());
   options.SetPrefix(address_sanitizer_retrieve_report_data_prefix);
   options.SetAutoApplyFixIts(false);
-  options.SetLanguage(eLanguageTypeObjC_plus_plus);
+  options.SetLanguage(eLanguageTypeC);
 
   if (auto [m, _] = GetPreferredAsanModule(process_sp->GetTarget()); m) {
     SymbolContextList sc_list;


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to