-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLDB][LLDB-DAP] Wire up DAP to listen to external progress events #123826
Conversation
@llvm/pr-subscribers-lldb Author: Jacob Lalonde (Jlalond) ChangesRecently I added SBProgress (#119052), and during that original commit I tested if the progress event was sent over LLDB-DAP, and it was. However upon the suggestion of @JDevlieghere and @labath we added an external category (#120171), which I did not test. This small patch wires up DAP to listen for external events by default, and adds the external category to the SBDebugger enumeration. Full diff: /~https://github.com/llvm/llvm-project/pull/123826.diff 2 Files Affected:
diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index eb371e33c4951c..7f56bf34c37388 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -46,8 +46,8 @@ class LLDB_API SBDebugger {
eBroadcastBitProgress = lldb::DebuggerBroadcastBit::eBroadcastBitProgress,
eBroadcastBitWarning = lldb::DebuggerBroadcastBit::eBroadcastBitWarning,
eBroadcastBitError = lldb::DebuggerBroadcastBit::eBroadcastBitError,
- eBroadcastBitProgressCategory =
- lldb::DebuggerBroadcastBit::eBroadcastBitProgressCategory,
+ eBroadcastBitExternalProgress =
+ lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgress,
};
SBDebugger();
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 7e8f7b5f6df679..6b12569d90a831 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -414,7 +414,8 @@ void SendStdOutStdErr(DAP &dap, lldb::SBProcess &process) {
void ProgressEventThreadFunction(DAP &dap) {
lldb::SBListener listener("lldb-dap.progress.listener");
dap.debugger.GetBroadcaster().AddListener(
- listener, lldb::SBDebugger::eBroadcastBitProgress);
+ listener, lldb::SBDebugger::eBroadcastBitProgress |
+ lldb::SBDebugger::eBroadcastBitExternalProgress);
dap.broadcaster.AddListener(listener, eBroadcastBitStopProgressThread);
lldb::SBEvent event;
bool done = false;
|
CC @youngdfb |
✅ With the latest revision this PR passed the C/C++ code formatter. |
1e14270
to
ae32d8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General looks good. But please remove the duplication.
lldb/include/lldb/API/SBDebugger.h
Outdated
eBroadcastBitExternalProgressCategory = | ||
lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgressCategory, | ||
eBroadcastBitExternalProgress = | ||
lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgress, | ||
eBroadcastBitExternalProgressCategory = | ||
lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgressCategory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two duplicated eBroadcastBitExternalProgressCategory
. Remove one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, fixed.
…ration in SBDebugger
ae32d8b
to
fac56f0
Compare
Recently I added SBProgress (#119052), and during that original commit I tested if the progress event was sent over LLDB-DAP, and it was. However upon the suggestion of @JDevlieghere and @labath we added an external category (#120171), which I did not test.
This small patch wires up DAP to listen for external events by default, and adds the external category to the SBDebugger enumeration.