| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 376 |
| 377 PrintToStderr("[end of stack trace]\n"); | 377 PrintToStderr("[end of stack trace]\n"); |
| 378 | 378 |
| 379 #if defined(OS_MACOSX) && !defined(OS_IOS) | 379 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 380 if (::signal(signal, SIG_DFL) == SIG_ERR) | 380 if (::signal(signal, SIG_DFL) == SIG_ERR) |
| 381 _exit(1); | 381 _exit(1); |
| 382 #else | 382 #else |
| 383 // Non-Mac OSes should probably reraise the signal as well, but the Linux | 383 // Non-Mac OSes should probably reraise the signal as well, but the Linux |
| 384 // sandbox tests break on CrOS devices. | 384 // sandbox tests break on CrOS devices. |
| 385 // https://code.google.com/p/chromium/issues/detail?id=551681 | 385 // https://code.google.com/p/chromium/issues/detail?id=551681 |
| 386 PrintToStderr("Calling _exit(1). Core file will not be generated.\n"); |
| 386 _exit(1); | 387 _exit(1); |
| 387 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 388 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 388 } | 389 } |
| 389 | 390 |
| 390 class PrintBacktraceOutputHandler : public BacktraceOutputHandler { | 391 class PrintBacktraceOutputHandler : public BacktraceOutputHandler { |
| 391 public: | 392 public: |
| 392 PrintBacktraceOutputHandler() {} | 393 PrintBacktraceOutputHandler() {} |
| 393 | 394 |
| 394 void HandleOutput(const char* output) override { | 395 void HandleOutput(const char* output) override { |
| 395 // NOTE: This code MUST be async-signal safe (it's used by in-process | 396 // NOTE: This code MUST be async-signal safe (it's used by in-process |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 *ptr = *start; | 811 *ptr = *start; |
| 811 *start++ = ch; | 812 *start++ = ch; |
| 812 } | 813 } |
| 813 return buf; | 814 return buf; |
| 814 } | 815 } |
| 815 | 816 |
| 816 } // namespace internal | 817 } // namespace internal |
| 817 | 818 |
| 818 } // namespace debug | 819 } // namespace debug |
| 819 } // namespace base | 820 } // namespace base |
| OLD | NEW |