[Lldb-commits] [lldb] cae735f - [lldb] Migrate runtime instrumentation plugins to ReportWarning
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 16 23:21:19 PDT 2022
Author: Jonas Devlieghere
Date: 2022-03-16T23:20:58-07:00
New Revision: cae735f72b4d1f8f98c68c63d5d9b0d7ee109b3d
URL: https://github.com/llvm/llvm-project/commit/cae735f72b4d1f8f98c68c63d5d9b0d7ee109b3d
DIFF: https://github.com/llvm/llvm-project/commit/cae735f72b4d1f8f98c68c63d5d9b0d7ee109b3d.diff
LOG: [lldb] Migrate runtime instrumentation plugins to ReportWarning
Added:
Modified:
lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
index 33b2b5dd51559..4746112873112 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
@@ -136,9 +136,11 @@ StructuredData::ObjectSP InstrumentationRuntimeASan::RetrieveReportData() {
exe_ctx, options, address_sanitizer_retrieve_report_data_command, "",
return_value_sp, eval_error);
if (result != eExpressionCompleted) {
- process_sp->GetTarget().GetDebugger().GetAsyncOutputStream()->Printf(
- "Warning: Cannot evaluate AddressSanitizer expression:\n%s\n",
- eval_error.AsCString());
+ StreamString ss;
+ ss << "cannot evaluate AddressSanitizer expression:\n";
+ ss << eval_error.AsCString();
+ Debugger::ReportWarning(ss.GetString().str(),
+ process_sp->GetTarget().GetDebugger().GetID());
return StructuredData::ObjectSP();
}
diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
index 977d8e4dbe073..55ef3d245411f 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
@@ -327,9 +327,11 @@ StructuredData::ObjectSP InstrumentationRuntimeTSan::RetrieveReportData(
exe_ctx, options, thread_sanitizer_retrieve_report_data_command, "",
main_value, eval_error);
if (result != eExpressionCompleted) {
- process_sp->GetTarget().GetDebugger().GetAsyncOutputStream()->Printf(
- "Warning: Cannot evaluate ThreadSanitizer expression:\n%s\n",
- eval_error.AsCString());
+ StreamString ss;
+ ss << "cannot evaluate ThreadSanitizer expression:\n";
+ ss << eval_error.AsCString();
+ Debugger::ReportWarning(ss.GetString().str(),
+ process_sp->GetTarget().GetDebugger().GetID());
return StructuredData::ObjectSP();
}
diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
index 8e7799dc07617..5544c5f08f3be 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
@@ -136,9 +136,11 @@ StructuredData::ObjectSP InstrumentationRuntimeUBSan::RetrieveReportData(
exe_ctx, options, ub_sanitizer_retrieve_report_data_command, "",
main_value, eval_error);
if (result != eExpressionCompleted) {
- target.GetDebugger().GetAsyncOutputStream()->Printf(
- "Warning: Cannot evaluate UndefinedBehaviorSanitizer expression:\n%s\n",
- eval_error.AsCString());
+ StreamString ss;
+ ss << "cannot evaluate UndefinedBehaviorSanitizer expression:\n";
+ ss << eval_error.AsCString();
+ Debugger::ReportWarning(ss.GetString().str(),
+ process_sp->GetTarget().GetDebugger().GetID());
return StructuredData::ObjectSP();
}
diff --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
index 14d9c4024689f..aaead88369b20 100644
--- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
+++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
@@ -72,7 +72,7 @@ const char *memory_history_asan_command_prefix = R"(
void *alloc_trace[256];
size_t alloc_count;
int alloc_tid;
-
+
void *free_trace[256];
size_t free_count;
int free_tid;
@@ -179,9 +179,11 @@ HistoryThreads MemoryHistoryASan::GetHistoryThreads(lldb::addr_t address) {
ExpressionResults expr_result = UserExpression::Evaluate(
exe_ctx, options, expr.GetString(), "", return_value_sp, eval_error);
if (expr_result != eExpressionCompleted) {
- process_sp->GetTarget().GetDebugger().GetAsyncOutputStream()->Printf(
- "Warning: Cannot evaluate AddressSanitizer expression:\n%s\n",
- eval_error.AsCString());
+ StreamString ss;
+ ss << "cannot evaluate AddressSanitizer expression:\n";
+ ss << eval_error.AsCString();
+ Debugger::ReportWarning(ss.GetString().str(),
+ process_sp->GetTarget().GetDebugger().GetID());
return result;
}
More information about the lldb-commits
mailing list