Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Initial break-point is lost in debugger late attach scenarios #15

Closed
gireeshpunathil opened this issue Feb 7, 2014 · 1 comment
Closed
Labels

Comments

@gireeshpunathil
Copy link
Member

Two scenarios:

  1. inline debugger attach:

actual output:

bash-4.2$ ./node debug --debug-brk a.js
< debugger listening on port 5858
connecting... ok
debug>

expected output:

bash-4.2$ ./node debug --debug-brk a.js
< debugger listening on port 5858
connecting... ok
break in a.js:1
1 debugger;
2 var i = 10;
3
debug>

  1. late attach:

terminal #1:

actual output:
bash-4.2$ ./node --debug-brk a.js
< debugger listening on port 5858

terminal #2:
bash-4.2$ ./node debug --debug-brk a.js
< debugger listening on port 5858
connecting... ok
debug>

expected output in terminal #2:

bash-4.2$ ./node debug --debug-brk a.js
< debugger listening on port 5858
connecting... ok
break in a.js:1
1 debugger;
2 var i = 10;
3
debug>

@gireeshpunathil
Copy link
Member Author

The issue is because of a wrong assumption that the parent (debugger) will be ready and listening by the time the debuggee start its execution. Once the debuggee starts, it opens up a socket in one thread and listens for client (debugger) connections, while in the other it goes ahead and triggers the execution of the code in debug mode. The first break point event is indeed triggered from the script, but depends on whether a debugger client is attached or not, this event is either processed or abandoned. While the inline case is reported in AIX, the late attach issue is seen in upstream as well.

The fix is to re-trigger any pending break-point events when the client connects.
Fixed through fc90f8c

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant