Chromium Code Reviews| Index: mojo/shell/child_process.cc |
| diff --git a/mojo/shell/child_process.cc b/mojo/shell/child_process.cc |
| index eecb98cb66f3534d0a6885393b1a8a7611909e5e..e56bb14d2e5f28e2c6a07af599bb719df7ae40df 100644 |
| --- a/mojo/shell/child_process.cc |
| +++ b/mojo/shell/child_process.cc |
| @@ -4,9 +4,11 @@ |
| #include "mojo/shell/child_process.h" |
| +#include "base/base_switches.h" |
| #include "base/bind.h" |
| #include "base/callback_helpers.h" |
| #include "base/command_line.h" |
| +#include "base/debug/debugger.h" |
| #include "base/files/file_path.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| @@ -279,6 +281,19 @@ int ChildProcessMain() { |
| DVLOG(2) << "ChildProcessMain()"; |
| const base::CommandLine& command_line = |
| *base::CommandLine::ForCurrentProcess(); |
| + if (command_line.HasSwitch(switches::kWaitForDebugger)) { |
| + std::string app = command_line.GetSwitchValueASCII(switches::kApp); |
| +#if defined(OS_WIN) |
| + MessageBox(NULL, command_line.GetSwitchValueNative(switches::kApp).c_str(), |
| + command_line.GetSwitchValueNative(switches::kApp).c_str(), |
| + MB_OK | MB_SETFOREGROUND); |
| +#else |
| + LOG(ERROR) << command_line.GetSwitchValueASCII(switches::kApp) |
| + << " waiting for GDB."; |
|
sky
2015/04/23 21:48:54
Can you add the process id to this output.
jam
2015/04/23 22:18:44
Done.
|
| + base::debug::WaitForDebugger(60, true); |
| +#endif |
| + } |
| + |
| embedder::ScopedPlatformHandle platform_channel = |
| embedder::PlatformChannelPair::PassClientHandleFromParentProcess( |
| command_line); |