diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 19:09:00 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 19:09:00 +0000 |
commit | 20595ea7d410241f8e44dde5768a9355dfc82a2d (patch) | |
tree | 780b09db9b4db1435ea7f63121f598c937ee6883 /chrome | |
parent | f0d78c06446769d190f3c8b1e7714de63553b3e5 (diff) | |
download | chromium_src-20595ea7d410241f8e44dde5768a9355dfc82a2d.zip chromium_src-20595ea7d410241f8e44dde5768a9355dfc82a2d.tar.gz chromium_src-20595ea7d410241f8e44dde5768a9355dfc82a2d.tar.bz2 |
posix: make ctl-C work within gdb for dropping to a console.
See comment in commit for gory details.
Review URL: http://codereview.chromium.org/53113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 8cc1e93..5281553 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -15,6 +15,8 @@ #include <atlapp.h> #include <malloc.h> #include <new.h> +#elif defined(OS_POSIX) +#include <signal.h> #endif #if defined(OS_LINUX) @@ -315,6 +317,20 @@ int ChromeMain(int argc, const char** argv) { browser_pid = StringToInt(WideToASCII(channel_name)); DCHECK(browser_pid != 0); + +#if defined(OS_POSIX) + // When you hit Ctrl-C in a terminal running the browser + // process, a SIGINT is delivered to the entire process group. + // When debugging the browser process via gdb, gdb catches the + // SIGINT for the browser process (and dumps you back to the gdb + // console) but doesn't for the child processes, killing them. + // The fix is to have child processes ignore SIGINT; they'll die + // on their own when the browser process goes away. + // Note that we *can't* rely on DebugUtil::BeingDebugged to catch this + // case because we are the child process, which is not being debugged. + if (!DebugUtil::BeingDebugged()) + signal(SIGINT, SIG_IGN); +#endif } SetupCRT(parsed_command_line); |