Skip to content

Commit

Permalink
chore: update CDP types, support new debugSymbols array format (#2157)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 authored Jan 8, 2025
1 parent a8859b0 commit 91ccbe5
Show file tree
Hide file tree
Showing 3 changed files with 3,333 additions and 765 deletions.
18 changes: 15 additions & 3 deletions src/adapter/dwarf/wasmSymbolProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,17 @@ export class WasmSymbolProvider implements IWasmSymbolProvider, IDisposable {

let symbolsUrl: URL | undefined;
try {
symbolsUrl = script.debugSymbols?.externalURL
? new URL(script.debugSymbols?.externalURL)
: undefined;
const symbols = script.debugSymbols;
if (isLegacyDebugSymbols(symbols) && symbols.externalURL) {
symbolsUrl = new URL(symbols.externalURL);
} else if (Array.isArray(symbols)) {
const entry = script.debugSymbols?.find(s =>
(s.type === 'EmbeddedDWARF' || s.type === 'ExternalDWARF') && s.externalURL
);
if (entry?.externalURL) {
symbolsUrl = new URL(entry.externalURL);
}
}
} catch {
// ignored
}
Expand Down Expand Up @@ -237,6 +245,10 @@ export class WasmSymbolProvider implements IWasmSymbolProvider, IDisposable {
}
}

const isLegacyDebugSymbols = (symbols: unknown): symbols is Cdp.Debugger.DebugSymbols => {
return !!(symbols as Cdp.Debugger.DebugSymbols)?.externalURL;
};

export interface IWasmVariableEvaluation {
type: string;
description: string | undefined;
Expand Down
Loading

0 comments on commit 91ccbe5

Please sign in to comment.