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 <signal.h> | 7 #include <signal.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 | 12 |
| 13 #ifdef __MIPSEL__ |
| 14 // SIGSTKFLT is not defined for MIPS. |
| 15 #define SIGSTKFLT SIGSEGV |
| 16 #endif |
| 17 |
13 namespace base { | 18 namespace base { |
14 namespace debug { | 19 namespace debug { |
15 | 20 |
16 bool EnableInProcessStackDumping() { | 21 bool EnableInProcessStackDumping() { |
17 // When running in an application, our code typically expects SIGPIPE | 22 // When running in an application, our code typically expects SIGPIPE |
18 // to be ignored. Therefore, when testing that same code, it should run | 23 // to be ignored. Therefore, when testing that same code, it should run |
19 // with SIGPIPE ignored as well. | 24 // with SIGPIPE ignored as well. |
20 // TODO(phajdan.jr): De-duplicate this SIGPIPE code. | 25 // TODO(phajdan.jr): De-duplicate this SIGPIPE code. |
21 struct sigaction action; | 26 struct sigaction action; |
22 memset(&action, 0, sizeof(action)); | 27 memset(&action, 0, sizeof(action)); |
(...skipping 28 matching lines...) Expand all Loading... |
51 // Restore the signal handler so that this method can work the next time. | 56 // Restore the signal handler so that this method can work the next time. |
52 signal(SIGSTKFLT, sig_handler); | 57 signal(SIGSTKFLT, sig_handler); |
53 } | 58 } |
54 | 59 |
55 void StackTrace::OutputToStream(std::ostream* os) const { | 60 void StackTrace::OutputToStream(std::ostream* os) const { |
56 NOTIMPLEMENTED(); | 61 NOTIMPLEMENTED(); |
57 } | 62 } |
58 | 63 |
59 } // namespace debug | 64 } // namespace debug |
60 } // namespace base | 65 } // namespace base |
OLD | NEW |