Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: src/debug.cc

Issue 491079: Reapply "wait for connection" feature implementation (Closed)
Patch Set: merge Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 bool Debugger::StartAgent(const char* name, int port) { 2486 static void StubMessageHandler2(const v8::Debug::Message& message) {
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
2487 if (Socket::Setup()) { 2504 if (Socket::Setup()) {
2488 agent_ = new DebuggerAgent(name, port); 2505 agent_ = new DebuggerAgent(name, port);
2489 agent_->Start(); 2506 agent_->Start();
2490 return true; 2507 return true;
2491 } 2508 }
2492 2509
2493 return false; 2510 return false;
2494 } 2511 }
2495 2512
2496 2513
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 2742
2726 2743
2727 void LockingCommandMessageQueue::Clear() { 2744 void LockingCommandMessageQueue::Clear() {
2728 ScopedLock sl(lock_); 2745 ScopedLock sl(lock_);
2729 queue_.Clear(); 2746 queue_.Clear();
2730 } 2747 }
2731 2748
2732 #endif // ENABLE_DEBUGGER_SUPPORT 2749 #endif // ENABLE_DEBUGGER_SUPPORT
2733 2750
2734 } } // namespace v8::internal 2751 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698