diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-11 00:46:10 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-11 00:46:10 +0000 |
commit | 72e24366504adcda1a99496c64eabad3a9a74315 (patch) | |
tree | 62bacd52f65c8e68472842b99ba10eb12bdbc8a6 /base/process_util_posix.cc | |
parent | 841084fb85c44324bbfead79e90f5af67efa646b (diff) | |
download | chromium_src-72e24366504adcda1a99496c64eabad3a9a74315.zip chromium_src-72e24366504adcda1a99496c64eabad3a9a74315.tar.gz chromium_src-72e24366504adcda1a99496c64eabad3a9a74315.tar.bz2 |
Break into the debugger if we have a stack dump and are currently debugging.
While debugging browser tests, I noticed a few stackdumps fly by without catching them. This code snippet breaks into the debugger only when it's being debugged.
BUG=None
TEST=kill -ABRT your process while debugging and see if you catch in the debugger.
Review URL: http://codereview.chromium.org/7003049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_posix.cc')
-rw-r--r-- | base/process_util_posix.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index 1ea90c3..287f5c7 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -18,6 +18,7 @@ #include "base/command_line.h" #include "base/compiler_specific.h" +#include "base/debug/debugger.h" #include "base/debug/stack_trace.h" #include "base/dir_reader_posix.h" #include "base/eintr_wrapper.h" @@ -105,6 +106,9 @@ int WaitpidWithTimeout(ProcessHandle handle, int64 wait_milliseconds, } void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) { + if (debug::BeingDebugged()) + debug::BreakDebugger(); + LOG(ERROR) << "Received signal " << signal; debug::StackTrace().PrintBacktrace(); |