OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3326 bool Debugger::StartAgent(const char* name, int port, | 3326 bool Debugger::StartAgent(const char* name, int port, |
3327 bool wait_for_connection) { | 3327 bool wait_for_connection) { |
3328 if (wait_for_connection) { | 3328 if (wait_for_connection) { |
3329 // Suspend V8 if it is already running or set V8 to suspend whenever | 3329 // Suspend V8 if it is already running or set V8 to suspend whenever |
3330 // it starts. | 3330 // it starts. |
3331 // Provide stub message handler; V8 auto-continues each suspend | 3331 // Provide stub message handler; V8 auto-continues each suspend |
3332 // when there is no message handler; we doesn't need it. | 3332 // when there is no message handler; we doesn't need it. |
3333 // Once become suspended, V8 will stay so indefinitely long, until remote | 3333 // Once become suspended, V8 will stay so indefinitely long, until remote |
3334 // debugger connects and issues "continue" command. | 3334 // debugger connects and issues "continue" command. |
3335 Debugger::message_handler_ = StubMessageHandler2; | 3335 Debugger::message_handler_ = StubMessageHandler2; |
3336 v8::Debug::DebugBreak(); | 3336 v8::Debug::DebugBreak(reinterpret_cast<v8::Isolate*>(isolate_)); |
3337 } | 3337 } |
3338 | 3338 |
3339 if (agent_ == NULL) { | 3339 if (agent_ == NULL) { |
3340 agent_ = new DebuggerAgent(isolate_, name, port); | 3340 agent_ = new DebuggerAgent(isolate_, name, port); |
3341 agent_->Start(); | 3341 agent_->Start(); |
3342 } | 3342 } |
3343 return true; | 3343 return true; |
3344 } | 3344 } |
3345 | 3345 |
3346 | 3346 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3748 { | 3748 { |
3749 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3749 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
3750 isolate_->debugger()->CallMessageDispatchHandler(); | 3750 isolate_->debugger()->CallMessageDispatchHandler(); |
3751 } | 3751 } |
3752 } | 3752 } |
3753 } | 3753 } |
3754 | 3754 |
3755 #endif // ENABLE_DEBUGGER_SUPPORT | 3755 #endif // ENABLE_DEBUGGER_SUPPORT |
3756 | 3756 |
3757 } } // namespace v8::internal | 3757 } } // namespace v8::internal |
OLD | NEW |