Skip to content

--debug does not provide debugger with 1st breakpoint context #8565

@jtlapp

Description

@jtlapp

Version: 6.2.2 - 6.6.0 (and maybe earlier versions)
Platform: 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Subsystem: node debug server

When using --debug instead of --debug-brk, node does not report contextual information about the first debugger statement breakpoint to the debugger. This is easy to recreate:

  1. Add a debugger statement to some file test.js.
  2. Run node --debug test.js.
  3. Separately launch node debug localhost:5858.
  4. Notice that the node debug client does not show the source code context for the first breakpoint. Type 'n' or 's' to advance to the next line, and suddenly the context (for the next line) shows.

The problem can also be created with node-inspector, but node-inspector does not work with 6.6.0, working most recently with 6.3.1. (See node-inspector #905.) To recreate with node-inspector:

  1. Add a debugger statement to some file test.js.
  2. Run node --debug=5859 test.js.
  3. Separately launch node-debug, letting it take port 5858 (to debug itself ???).
  4. Load http://127.0.0.1:8080/?port=5859.
  5. Notice that node-inspector shows that execution is paused in node module code. If you do a single step, suddenly node-inspector gets the correct information and jumps to the correct location in test.js.

Because I can recreate the problem in two different debugger clients, I assume the problem is in node.js.

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