Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug/stack_trace.h" | 5 #include "base/debug/stack_trace.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 if ((i + 1) % 4 == 0) | 367 if ((i + 1) % 4 == 0) |
| 368 PrintToStderr("\n"); | 368 PrintToStderr("\n"); |
| 369 } | 369 } |
| 370 PrintToStderr("\n"); | 370 PrintToStderr("\n"); |
| 371 #endif // ARCH_CPU_X86_FAMILY | 371 #endif // ARCH_CPU_X86_FAMILY |
| 372 #endif // defined(OS_LINUX) | 372 #endif // defined(OS_LINUX) |
| 373 | 373 |
| 374 PrintToStderr("[end of stack trace]\n"); | 374 PrintToStderr("[end of stack trace]\n"); |
| 375 | 375 |
| 376 #if defined(OS_MACOSX) && !defined(OS_IOS) | 376 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 377 if (::signal(signal, SIG_DFL) == SIG_ERR) | 377 ::signal(signal, SIG_DFL); |
|
dcheng
2016/09/09 05:15:50
Why is this change necessary as well?
Xianzhu
2016/09/09 05:20:13
Without this, the forced crash will be ignored.
A
| |
| 378 _exit(1); | 378 _exit(1); |
| 379 #else | 379 #else |
| 380 // Non-Mac OSes should probably reraise the signal as well, but the Linux | 380 // Non-Mac OSes should probably reraise the signal as well, but the Linux |
| 381 // sandbox tests break on CrOS devices. | 381 // sandbox tests break on CrOS devices. |
| 382 // https://code.google.com/p/chromium/issues/detail?id=551681 | 382 // https://code.google.com/p/chromium/issues/detail?id=551681 |
| 383 _exit(1); | 383 _exit(1); |
| 384 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 384 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 385 } | 385 } |
| 386 | 386 |
| 387 class PrintBacktraceOutputHandler : public BacktraceOutputHandler { | 387 class PrintBacktraceOutputHandler : public BacktraceOutputHandler { |
| 388 public: | 388 public: |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 *ptr = *start; | 805 *ptr = *start; |
| 806 *start++ = ch; | 806 *start++ = ch; |
| 807 } | 807 } |
| 808 return buf; | 808 return buf; |
| 809 } | 809 } |
| 810 | 810 |
| 811 } // namespace internal | 811 } // namespace internal |
| 812 | 812 |
| 813 } // namespace debug | 813 } // namespace debug |
| 814 } // namespace base | 814 } // namespace base |
| OLD | NEW |