[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu May 2 16:08:05 PDT 2024
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/90913
Always emit diagnostic events to the system log so that they end up in the sysdiagnose on Darwin.
>From 458913020dd443c0ca92caa63cf8477035f8c5cc Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Thu, 2 May 2024 15:47:46 -0700
Subject: [PATCH] [lldb] Always emit diagnostic events to the system log
Always emit diagnostic events to the system log so that they end up in
the sysdiagnose on Darwin.
---
lldb/source/Core/Debugger.cpp | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index cac4642873b772..c5ab99fac75d27 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1512,7 +1512,22 @@ void Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type,
std::string message,
std::optional<lldb::user_id_t> debugger_id,
std::once_flag *once) {
+ auto GetSystemLogLevel = [](DiagnosticEventData::Type type) {
+ switch (type) {
+ case DiagnosticEventData::Type::Info:
+ return Host::eSystemLogInfo;
+ case DiagnosticEventData::Type::Warning:
+ return Host::eSystemLogWarning;
+ case DiagnosticEventData::Type::Error:
+ return Host::eSystemLogError;
+ }
+ llvm_unreachable("All cases handled above!");
+ };
+
auto ReportDiagnosticLambda = [&]() {
+ // Always log diagnostics to the system log.
+ Host::SystemLog(GetSystemLogLevel(type), message);
+
// The diagnostic subsystem is optional but we still want to broadcast
// events when it's disabled.
if (Diagnostics::Enabled())
More information about the lldb-commits
mailing list