diff options
Diffstat (limited to 'deps/v8/src/debug.cc')
-rw-r--r-- | deps/v8/src/debug.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/deps/v8/src/debug.cc b/deps/v8/src/debug.cc index 2c4552eff..fbe09391e 100644 --- a/deps/v8/src/debug.cc +++ b/deps/v8/src/debug.cc @@ -2483,7 +2483,24 @@ Handle<Object> Debugger::Call(Handle<JSFunction> fun, } -bool Debugger::StartAgent(const char* name, int port) { +static void StubMessageHandler2(const v8::Debug::Message& message) { + // Simply ignore message. +} + + +bool Debugger::StartAgent(const char* name, int port, + bool wait_for_connection) { + if (wait_for_connection) { + // Suspend V8 if it is already running or set V8 to suspend whenever + // it starts. + // Provide stub message handler; V8 auto-continues each suspend + // when there is no message handler; we doesn't need it. + // Once become suspended, V8 will stay so indefinitely long, until remote + // debugger connects and issues "continue" command. + Debugger::message_handler_ = StubMessageHandler2; + v8::Debug::DebugBreak(); + } + if (Socket::Setup()) { agent_ = new DebuggerAgent(name, port); agent_->Start(); |