[Lldb-commits] [lldb] [lldb][lldb-dap] show modules pane if supported by the adapter (PR #140603)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Mon May 19 16:29:50 PDT 2025
================
@@ -70,9 +71,21 @@ export class DebugSessionTracker
/** Clear information from the active session. */
private onExit(session: vscode.DebugSession) {
this.modules.delete(session);
+ // close when there is no more sessions
+ if (this.modules.size <= 0) {
+ this.showModulesTreeView(false);
+ }
this.modulesChanged.fire();
}
+ private showModulesTreeView(showModules: boolean) {
+ vscode.commands.executeCommand(
+ "setContext",
+ "lldb-dap.showModules",
+ showModules,
+ );
----------------
ashgti wrote:
This will set the context globally, however the we should be checking the active debug session and updating this value. Otherwise this UI will show the list for any debug session with modules, not the active one.
We can add a listener for `vscode.debug.onDidChangeActiveDebugSession` to update this value and our module tracker is tracking by session, so we can use the session to track which modules are associated with the active session.
That or the we should move this logic into the `ModulesDataProvider` which is checking the `vscode.debug.activeDebugSession` already.
https://github.com/llvm/llvm-project/pull/140603
More information about the lldb-commits
mailing list