summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2012-03-28 01:37:54 +0700
committerFedor Indutny <fedor.indutny@gmail.com>2012-03-28 01:37:54 +0700
commit5e8c2b0768f32051457cb6cb7e068722e4348fa4 (patch)
tree289c578df180503ced76619543f94237e05a2f3c /src
parent698e795a5ffb617c5a3e3e79de7dfdd0ce637695 (diff)
downloadnode-5e8c2b0768f32051457cb6cb7e068722e4348fa4.tar.gz
debugger: use v8 api to wait for a connection
Use v8::Debug::EnableAgent(_, _, true) to wait for incoming debugger-client connection before emitting any break (or other) events. This commit should fix test/simple/test-debugger-repl faults.
Diffstat (limited to 'src')
-rw-r--r--src/node.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/node.cc b/src/node.cc
index 08862d47f..907bd415f 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -2390,15 +2390,9 @@ static void EnableDebug(bool wait_connect) {
node_isolate->Enter();
// Start the debug thread and it's associated TCP server on port 5858.
- bool r = v8::Debug::EnableAgent("node " NODE_VERSION, debug_port);
-
- if (wait_connect) {
- // Set up an empty handler so v8 will not continue until a debugger
- // attaches. This is the same behavior as Debug::EnableAgent(_,_,true)
- // except we don't break at the beginning of the script.
- // see Debugger::StartAgent in debug.cc of v8/src
- v8::Debug::SetMessageHandler2(node::DebugBreakMessageHandler);
- }
+ bool r = v8::Debug::EnableAgent("node " NODE_VERSION,
+ debug_port,
+ wait_connect);
// Crappy check that everything went well. FIXME
assert(r);