Search code examples
javascriptv8

Breakpoints in d8 debugger. Do they exist?


I googled info about v8 and its d8 debugger api and flags but didn't find any information about way to set breakpoints or step through code. Did I miss something?

So is there a way to set a breakpoint at a particular line and column? If so then how it should be done.

Update: debugger; statement is not what I am looking for. I am looking for breakpoints that can be set at particular line/column

Update: I speak about d8 (c++ shell program) not about dev tools that are build on top of it


Solution

  • V8 developer here. The d8 shell does not contain a debugger.

    When you run it with --enable-inspector, it exposes access to the "InspectorProtocol" API, which makes it possible to run tests for inspector/debugger functionality in d8. See the link Bergi provided, or the tests in V8's repository, for details and examples. This is not intended for interactive usage though. (Doing so would be possible, strictly speaking, but extremely inconvenient.)

    If you want to debug JavaScript, Chrome's DevTools are the recommended approach.