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

Unified Diff: base/debug/stack_trace_posix.cc

Issue 2312393002: Debug exit code (Closed)
Patch Set: abort instead of int3 Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/debugger_posix.cc ('k') | base/logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 27a656e6caffe7a3efc58fda7c4758b5d7fcdf77..2ce584059227056f77c106f15a16a91e6e3e0894 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -221,10 +221,11 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
if (BeingDebugged())
BreakDebugger();
- PrintToStderr("Received signal ");
+ PrintToStderr("Received SSSS signal ");
char buf[1024] = { 0 };
internal::itoa_r(signal, buf, sizeof(buf), 10, 0);
PrintToStderr(buf);
+ PrintToStderr("\n");
if (signal == SIGBUS) {
if (info->si_code == BUS_ADRALN)
PrintToStderr(" BUS_ADRALN ");
@@ -296,7 +297,9 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
}
#endif
+ PrintToStderr("Before stacktrace print\n");
debug::StackTrace().Print();
+ PrintToStderr("After stacktrace print\n");
#if defined(OS_LINUX)
#if ARCH_CPU_X86_FAMILY
@@ -374,12 +377,15 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
PrintToStderr("[end of stack trace]\n");
#if defined(OS_MACOSX) && !defined(OS_IOS)
- if (::signal(signal, SIG_DFL) == SIG_ERR)
+ if (::signal(signal, SIG_DFL) == SIG_ERR) {
+ PrintToStderr("::signal(signal, SIG_DFL)\n");
_exit(1);
+ }
#else
// Non-Mac OSes should probably reraise the signal as well, but the Linux
// sandbox tests break on CrOS devices.
// https://code.google.com/p/chromium/issues/detail?id=551681
+ PrintToStderr("Before _exit(1)\n");
_exit(1);
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
}
@@ -683,6 +689,8 @@ bool EnableInProcessStackDumping() {
SandboxSymbolizeHelper::GetInstance();
#endif // USE_SYMBOLIZE
+ fprintf(stderr, "EnableInProcessStackDumping\n");
+
// When running in an application, our code typically expects SIGPIPE
// to be ignored. Therefore, when testing that same code, it should run
// with SIGPIPE ignored as well.
« no previous file with comments | « base/debug/debugger_posix.cc ('k') | base/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698