OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 } | 2476 } |
2477 | 2477 |
2478 static const int kArgc = 2; | 2478 static const int kArgc = 2; |
2479 Object** argv[kArgc] = { exec_state.location(), data.location() }; | 2479 Object** argv[kArgc] = { exec_state.location(), data.location() }; |
2480 Handle<Object> result = Execution::Call(fun, Factory::undefined_value(), | 2480 Handle<Object> result = Execution::Call(fun, Factory::undefined_value(), |
2481 kArgc, argv, pending_exception); | 2481 kArgc, argv, pending_exception); |
2482 return result; | 2482 return result; |
2483 } | 2483 } |
2484 | 2484 |
2485 | 2485 |
2486 static void StubMessageHandler2(const v8::Debug::Message& message) { | 2486 bool Debugger::StartAgent(const char* name, int port) { |
2487 // Simply ignore message. | |
2488 } | |
2489 | |
2490 | |
2491 bool Debugger::StartAgent(const char* name, int port, | |
2492 bool wait_for_connection) { | |
2493 if (wait_for_connection) { | |
2494 // Suspend V8 if it is already running or set V8 to suspend whenever | |
2495 // it starts. | |
2496 // Provide stub message handler; V8 auto-continues each suspend | |
2497 // when there is no message handler; we doesn't need it. | |
2498 // Once become suspended, V8 will stay so indefinitely long, until remote | |
2499 // debugger connects and issues "continue" command. | |
2500 Debugger::message_handler_ = StubMessageHandler2; | |
2501 v8::Debug::DebugBreak(); | |
2502 } | |
2503 | |
2504 if (Socket::Setup()) { | 2487 if (Socket::Setup()) { |
2505 agent_ = new DebuggerAgent(name, port); | 2488 agent_ = new DebuggerAgent(name, port); |
2506 agent_->Start(); | 2489 agent_->Start(); |
2507 return true; | 2490 return true; |
2508 } | 2491 } |
2509 | 2492 |
2510 return false; | 2493 return false; |
2511 } | 2494 } |
2512 | 2495 |
2513 | 2496 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 | 2725 |
2743 | 2726 |
2744 void LockingCommandMessageQueue::Clear() { | 2727 void LockingCommandMessageQueue::Clear() { |
2745 ScopedLock sl(lock_); | 2728 ScopedLock sl(lock_); |
2746 queue_.Clear(); | 2729 queue_.Clear(); |
2747 } | 2730 } |
2748 | 2731 |
2749 #endif // ENABLE_DEBUGGER_SUPPORT | 2732 #endif // ENABLE_DEBUGGER_SUPPORT |
2750 | 2733 |
2751 } } // namespace v8::internal | 2734 } } // namespace v8::internal |
OLD | NEW |