diff options
author | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 18:12:40 +0000 |
---|---|---|
committer | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 18:12:40 +0000 |
commit | 1f93ac11229c08f50f8fddb2359306e14fc0e32e (patch) | |
tree | 0397780ee790ddca8cf0f0177f32ea58e8e17a47 | |
parent | 319bddcde6785e89817fd6c9f038c2d1c372342b (diff) | |
download | chromium_src-1f93ac11229c08f50f8fddb2359306e14fc0e32e.zip chromium_src-1f93ac11229c08f50f8fddb2359306e14fc0e32e.tar.gz chromium_src-1f93ac11229c08f50f8fddb2359306e14fc0e32e.tar.bz2 |
Adding debugging switches to Worker process startup on POSIX systems.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1023005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41852 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.cc | 26 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/debug_flags.cc | 4 | ||||
-rw-r--r-- | chrome/worker/worker_main.cc | 2 |
5 files changed, 26 insertions, 10 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index a0d75ef..ba01a2d 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -108,11 +108,6 @@ bool WorkerProcessHost::Init() { } if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kWorkerStartupDialog)) { - cmd_line->AppendSwitch(switches::kWorkerStartupDialog); - } - - if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableLogging)) { cmd_line->AppendSwitch(switches::kEnableLogging); } @@ -138,6 +133,27 @@ bool WorkerProcessHost::Init() { #if defined(OS_POSIX) if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kWaitForDebuggerChildren)) { + // Look to pass-on the kWaitForDebugger flag. + std::string value = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kWaitForDebuggerChildren); + if (value.empty() || value == switches::kWorkerProcess) { + cmd_line->AppendSwitch(switches::kWaitForDebugger); + } + } + + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugChildren)) { + // Look to pass-on the kDebugOnStart flag. + std::string value = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kDebugChildren); + if (value.empty() || value == switches::kWorkerProcess) { + // launches a new xterm, and runs the worker process in gdb, reading + // optional commands from gdb_chrome file in the working directory. + cmd_line->PrependWrapper(L"xterm -e gdb -x gdb_chrome --args"); + } + } + + if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kRendererCmdPrefix)) { const std::wstring prefix = CommandLine::ForCurrentProcess()->GetSwitchValue( diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index ab66cdf..e3bc887 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -746,9 +746,6 @@ const char kWinHttpProxyResolver[] = "winhttp-proxy-resolver"; // Causes the process to run as a worker subprocess. const char kWorkerProcess[] = "worker"; -// Causes the worker process to display a dialog on launch -const char kWorkerStartupDialog[] = "worker-startup-dialog"; - // The prefix used when starting the zygote process. (i.e. 'gdb --args') const char kZygoteCmdPrefix[] = "zygote-cmd-prefix"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index bddd7b3..eb3b06e 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -211,7 +211,6 @@ extern const char kWebWorkerProcessPerCore[]; extern const char kWebWorkerShareProcesses[]; extern const char kWinHttpProxyResolver[]; extern const char kWorkerProcess[]; -extern const char kWorkerStartupDialog[]; extern const char kZygoteCmdPrefix[]; extern const char kZygoteProcess[]; diff --git a/chrome/common/debug_flags.cc b/chrome/common/debug_flags.cc index 4924f19..dd2eaee 100644 --- a/chrome/common/debug_flags.cc +++ b/chrome/common/debug_flags.cc @@ -20,6 +20,8 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, std::string value = current_cmd_line.GetSwitchValueASCII( switches::kDebugChildren); if (value.empty() || + (type == ChildProcessInfo::WORKER_PROCESS && + value == switches::kWorkerProcess) || (type == ChildProcessInfo::RENDER_PROCESS && value == switches::kRendererProcess) || (type == ChildProcessInfo::PLUGIN_PROCESS && @@ -33,6 +35,8 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, std::string value = current_cmd_line.GetSwitchValueASCII( switches::kWaitForDebuggerChildren); if (value.empty() || + (type == ChildProcessInfo::WORKER_PROCESS && + value == switches::kWorkerProcess) || (type == ChildProcessInfo::RENDER_PROCESS && value == switches::kRendererProcess) || (type == ChildProcessInfo::PLUGIN_PROCESS && diff --git a/chrome/worker/worker_main.cc b/chrome/worker/worker_main.cc index a91ac74..86b352b 100644 --- a/chrome/worker/worker_main.cc +++ b/chrome/worker/worker_main.cc @@ -41,7 +41,7 @@ int WorkerMain(const MainFunctionParams& parameters) { #endif const CommandLine& parsed_command_line = parameters.command_line_; - if (parsed_command_line.HasSwitch(switches::kWorkerStartupDialog)) { + if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { ChildProcess::WaitForDebugger(L"Worker"); } |