[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)
Ely Ronnen via lldb-commits
lldb-commits at lists.llvm.org
Sat Aug 16 05:54:42 PDT 2025
================
@@ -0,0 +1,185 @@
+import * as vscode from "vscode";
+import { DebugProtocol } from "@vscode/debugprotocol";
+
+import { DebugSessionTracker } from "../debug-session-tracker";
+import { DisposableContext } from "../disposable-context";
+
+import { DAPSymbolType } from "..";
+
+export class SymbolsProvider extends DisposableContext {
+ constructor(
+ private readonly tracker: DebugSessionTracker,
+ private readonly extensionContext: vscode.ExtensionContext,
+ ) {
+ super();
+
+ this.pushSubscription(vscode.commands.registerCommand(
+ "lldb-dap.debug.showSymbols",
+ () => {
+ this.SelectModuleAndShowSymbols();
+ },
+ ));
+
+ this.pushSubscription(vscode.commands.registerCommand(
+ "lldb-dap.modules.showSymbols",
+ (moduleItem: DebugProtocol.Module) => {
+ const session = vscode.debug.activeDebugSession;
+ if (!session) {
+ return;
+ }
+ this.showSymbolsForModule(session, moduleItem);
+ },
+ ));
+ }
+
+ static async doesServerSupportSymbolsRequest(session: vscode.DebugSession): Promise<boolean> {
----------------
eronnen wrote:
Currently VS Code doesn't provide API to read the capability and there is no request to get it except for the `InitializeRequest`, so it will still be a backwards compatibility issue getting this capability...
I ended up adding code to get the lldb version through `evaluate` command and enabling the symbols request only if it's 22 and up, WDYT?
https://github.com/llvm/llvm-project/pull/153836
More information about the lldb-commits
mailing list