From 5b17eb1c1e152a6d7dbcb94d7613bc2a7ea0b92b Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 24 Oct 2022 11:13:51 -0700 Subject: [PATCH] [lldb] Fix stale diagnostic event comments (NFC) The diagnostic events were heavily inspired by the progress events and several comments incorrectly referenced "progress" rather than "diagnostic" events. --- lldb/include/lldb/Core/Debugger.h | 18 +++++++++--------- lldb/source/Core/Debugger.cpp | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index cfab213..394dac3 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -383,17 +383,17 @@ public: /// Report warning events. /// - /// Progress events will be delivered to any debuggers that have listeners - /// for the eBroadcastBitError. + /// Warning events will be delivered to any debuggers that have listeners + /// for the eBroadcastBitWarning. /// /// \param[in] message /// The warning message to be reported. /// /// \param [in] debugger_id /// If this optional parameter has a value, it indicates the unique - /// debugger identifier that this progress should be delivered to. If this - /// optional parameter does not have a value, the progress will be - /// delivered to all debuggers. + /// debugger identifier that this diagnostic should be delivered to. If + /// this optional parameter does not have a value, the diagnostic event + /// will be delivered to all debuggers. /// /// \param [in] once /// If a pointer is passed to a std::once_flag, then it will be used to @@ -405,7 +405,7 @@ public: /// Report error events. /// - /// Progress events will be delivered to any debuggers that have listeners + /// Error events will be delivered to any debuggers that have listeners /// for the eBroadcastBitError. /// /// \param[in] message @@ -413,9 +413,9 @@ public: /// /// \param [in] debugger_id /// If this optional parameter has a value, it indicates the unique - /// debugger identifier that this progress should be delivered to. If this - /// optional parameter does not have a value, the progress will be - /// delivered to all debuggers. + /// debugger identifier that this diagnostic should be delivered to. If + /// this optional parameter does not have a value, the diagnostic event + /// will be delivered to all debuggers. /// /// \param [in] once /// If a pointer is passed to a std::once_flag, then it will be used to diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 6ce811b..e129792 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1338,7 +1338,7 @@ void Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type, llvm::Optional debugger_id, std::once_flag *once) { auto ReportDiagnosticLambda = [&]() { - // Check if this progress is for a specific debugger. + // Check if this diagnostic is for a specific debugger. if (debugger_id) { // It is debugger specific, grab it and deliver the event if the debugger // still exists. @@ -1347,8 +1347,8 @@ void Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type, PrivateReportDiagnostic(*debugger_sp, type, std::move(message), true); return; } - // The progress event is not debugger specific, iterate over all debuggers - // and deliver a progress event to each one. + // The diagnostic event is not debugger specific, iterate over all debuggers + // and deliver a diagnostic event to each one. if (g_debugger_list_ptr && g_debugger_list_mutex_ptr) { std::lock_guard guard(*g_debugger_list_mutex_ptr); for (const auto &debugger : *g_debugger_list_ptr) @@ -1372,7 +1372,6 @@ void Debugger::ReportWarning(std::string message, void Debugger::ReportError(std::string message, llvm::Optional debugger_id, std::once_flag *once) { - ReportDiagnosticImpl(DiagnosticEventData::Type::Error, std::move(message), debugger_id, once); } -- 2.7.4