Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspector hangs if try to call from Console #13320

Closed
darky opened this issue May 30, 2017 · 4 comments · Fixed by #13350
Closed

Inspector hangs if try to call from Console #13320

darky opened this issue May 30, 2017 · 4 comments · Fixed by #13350
Assignees
Labels
inspector Issues and PRs related to the V8 inspector protocol

Comments

@darky
Copy link
Contributor

darky commented May 30, 2017

  • Version: 8.0.0 (seems all before)
  • Platform: Linux 4.10.0-20-generic Ubuntu x86_64
  1. Simply run process with function, accessible from global namespace
  2. Set breakpoint inside this function.
  3. Call this function from "Console"
  4. Press "Next step"
  5. Inspector hangs with message "Debugger paused", not interactive more.
@mscdex mscdex added the inspector Issues and PRs related to the V8 inspector protocol label May 30, 2017
@mscdex
Copy link
Contributor

mscdex commented May 30, 2017

/cc @nodejs/v8-inspector

@eugeneo
Copy link
Contributor

eugeneo commented May 30, 2017

Can you clarify please? I cannot reproduce. This is what I was doing:

  1. My script:
function sum() {
    var a = 1;
    var b = 2;
    var c = a + b;
    console.log(c);
}

function doCall() {
  sum();
  setTimeout(doCall, 1000);
}

doCall();
  1. Node is started as node --inspect myscript.js
  2. Breakpoint is set on the line 9 (the one that calls sum from doCall)
  3. Once the debugger stops, I set a breakpoint on like 2 (var a = 1;) and execute sum() from the console.
  4. I press next.

What I see:

  1. Debugger does not break in the sum() when I run the function from the console.
  2. I can step as expected, no hanging observed.

@darky
Copy link
Contributor Author

darky commented May 31, 2017

@eugeneo, working scenario:

  1. create in empty dir index.js
  2. npm install restify
  3. Put this in index.js:
global.sum = function sum() {
    var a = 1;
    var b = 2;
    var c = a + b;
    console.log(c);
}

require("restify").createServer().listen();
  1. Run node --inspect index.js
  2. Copy-paste Chrome Debugging URL to Chrome tab
  3. Set breakpoint on line var a = 1;
  4. Run from "Console" sum()
  5. Breakpoint catched, press go next into or over (F10 or F11)
  6. Inspector hangs with "Debugger paused", not interactive more. But should to go on line var b = 2

@eugeneo
Copy link
Contributor

eugeneo commented May 31, 2017

Thank you. I confirmed the issue, looking into it now.

@eugeneo eugeneo self-assigned this May 31, 2017
jasnell pushed a commit that referenced this issue Jun 5, 2017
This change allows reentering the message dispatch loop when the Node is
paused. This is necessary when the pause happened as a result of the
message sent by a debug frontend, such as evaluating a function with a
breakpoint inside.

Fixes: #13320
PR-URL: #13350
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants