-
Notifications
You must be signed in to change notification settings - Fork 15k
[lldb][lldb-dap] show modules pane if supported by the adapter #140603
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
Conversation
Fixes llvm#140589 Added logic to dynamically set the `lldb-dap.showModules` context based on the presence of modules in the debug session.
|
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesFixes #140589 Full diff: https://github.com/llvm/llvm-project/pull/140603.diff 2 Files Affected:
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index d5ca604798799..7f90d5535b54b 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -787,7 +787,7 @@
{
"id": "lldb-dap.modules",
"name": "Modules",
- "when": "inDebugMode && debugType == 'lldb-dap'",
+ "when": "inDebugMode && debugType == 'lldb-dap' && lldb-dap.showModules",
"icon": "$(symbol-module)"
}
]
diff --git a/lldb/tools/lldb-dap/src-ts/debug-session-tracker.ts b/lldb/tools/lldb-dap/src-ts/debug-session-tracker.ts
index 1ce190938d9c7..d9c3c617e6d85 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-session-tracker.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-session-tracker.ts
@@ -52,6 +52,7 @@ export class DebugSessionTracker
createDebugAdapterTracker(
session: vscode.DebugSession,
): vscode.ProviderResult<vscode.DebugAdapterTracker> {
+ this.showModulesTreeView(false);
return {
onDidSendMessage: (message) => this.onDidSendMessage(session, message),
onExit: () => this.onExit(session),
@@ -73,6 +74,14 @@ export class DebugSessionTracker
this.modulesChanged.fire();
}
+ private showModulesTreeView(showModules: boolean) {
+ vscode.commands.executeCommand(
+ "setContext",
+ "lldb-dap.showModules",
+ showModules,
+ );
+ }
+
private onDidSendMessage(
session: vscode.DebugSession,
message: DebugProtocol.ProtocolMessage,
@@ -102,6 +111,8 @@ export class DebugSessionTracker
console.error("unexpected module event reason");
break;
}
+
+ this.showModulesTreeView(modules.length > 0);
this.modules.set(session, modules);
this.modulesChanged.fire();
}
|
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.
Thanks for the quick turnaround!
Added logic to dynamically set the `lldb-dap.showModules` context based on the presence of modules in the debug session.
Added logic to dynamically set the `lldb-dap.showModules` context based on the presence of modules in the debug session.
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.
LGTM modulo comments.
Fixes #140589
Added logic to dynamically set the
lldb-dap.showModulescontext based on the presence of modules in the debug session.