Skip to content

Cannot list C++ sources or hit a breakpoint with large WASM bundles #10

@ecorm

Description

@ecorm

Environment info:

  • Windows 10
  • "JavaScript and TypeScript Nightly" extension
  • "WebAssembly DWARF Debugging" extension version 1.0.1.
  • VSCode version 1.95.1.

I have a large 274MB WASM file served to a browser that I've been able to successfully debug using Chrome via its WASM DWARF debugging extension.

I cannot get VSCode to list any C++ source files in the Loaded Scripts window, nor can I get it to hit any breakpoints in a C++ file.

I can see the myapp.wasm file under all the worker threads in the Loaded Scripts window, but no C++ source files appear next to it.

If I try to open the myapp.wat file, it loads the following text:

Could not load source 'localhost/myapp.wat': Error processing source: RangeError: Invalid string length
      at Array.join (<anonymous>)
      at vg.getDisassembly (c:\Users\emile.cormier\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:72:20864)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async ht.content (c:\Users\emile.cormier\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:70:4385)
      at async r._onSource (c:\Users\emile.cormier\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:134:3006)
      at async ou._onMessage (c:\Users\emile.cormier\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:48:4942).

Searching for "RangeError: Invalid string length" reveals that the maximum Javascript string length is roughly 268 million characters, which my non-disassembled 274MB WASM file already exceeds.

I also noticed that the Output > Windows outputs these errors:

2024-11-07 15:41:21.851 [error] [Extension Host] (node:30644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11
uncaughtException listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

(Use `Code --trace-warnings ...` to show where the warning was created)

2024-11-07 15:41:21.860 [error] [Extension Host] (node:30644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

2024-11-07 15:53:08.204 [error] [Extension Host] (node:30644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [Worker]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

The timestamps seem to correspond to when I launch and stop the debugging session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions