| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "base/debug_util.h" | 6 #include "base/debug_util.h" |
| 7 | 7 |
| 8 #if defined(OS_LINUX) | 8 #if defined(OS_LINUX) |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #include <execinfo.h> | 10 #include <execinfo.h> |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void StackTrace::PrintBacktrace() { | 112 void StackTrace::PrintBacktrace() { |
| 113 fflush(stderr); | 113 fflush(stderr); |
| 114 backtrace_symbols_fd(&trace_[0], trace_.size(), STDERR_FILENO); | 114 backtrace_symbols_fd(&trace_[0], trace_.size(), STDERR_FILENO); |
| 115 } | 115 } |
| 116 | 116 |
| 117 #elif defined(OS_MACOSX) | 117 #elif defined(OS_MACOSX) |
| 118 | 118 |
| 119 // TODO(port): complete this code | 119 // TODO(port): complete this code |
| 120 StackTrace::StackTrace() { } | 120 StackTrace::StackTrace() { } |
| 121 | 121 |
| 122 StackTrace::PrintBacktrace() { | 122 void StackTrace::PrintBacktrace() { |
| 123 NOTIMPLEMENTED(); | 123 NOTIMPLEMENTED(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 #endif // defined(OS_MACOSX) | 126 #endif // defined(OS_MACOSX) |
| 127 | 127 |
| 128 const void *const *StackTrace::Addresses(size_t* count) { | 128 const void *const *StackTrace::Addresses(size_t* count) { |
| 129 *count = trace_.size(); | 129 *count = trace_.size(); |
| 130 if (trace_.size()) | 130 if (trace_.size()) |
| 131 return &trace_[0]; | 131 return &trace_[0]; |
| 132 return NULL; | 132 return NULL; |
| 133 } | 133 } |
| OLD | NEW |