| 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 <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 const void *const *StackTrace::Addresses(size_t* count) const { | 208 const void *const *StackTrace::Addresses(size_t* count) const { |
| 209 *count = count_; | 209 *count = count_; |
| 210 if (count_) | 210 if (count_) |
| 211 return trace_; | 211 return trace_; |
| 212 return NULL; | 212 return NULL; |
| 213 } | 213 } |
| 214 | 214 |
| 215 std::string StackTrace::ToString() const { | 215 std::string StackTrace::ToString() const { |
| 216 std::stringstream stream; | 216 std::stringstream stream; |
| 217 #if !defined(__UCLIBC__) | 217 #if !defined(__UCLIBC__) && !defined(_AIX) |
| 218 OutputToStream(&stream); | 218 OutputToStream(&stream); |
| 219 #endif | 219 #endif |
| 220 return stream.str(); | 220 return stream.str(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) | 223 #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) |
| 224 | 224 |
| 225 size_t TraceStackFramePointers(const void** out_trace, | 225 size_t TraceStackFramePointers(const void** out_trace, |
| 226 size_t max_depth, | 226 size_t max_depth, |
| 227 size_t skip_initial) { | 227 size_t skip_initial) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 ScopedStackFrameLinker::~ScopedStackFrameLinker() { | 268 ScopedStackFrameLinker::~ScopedStackFrameLinker() { |
| 269 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); | 269 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); |
| 270 CHECK_EQ(parent_fp_, previous_parent_fp) | 270 CHECK_EQ(parent_fp_, previous_parent_fp) |
| 271 << "Stack frame's parent pointer has changed!"; | 271 << "Stack frame's parent pointer has changed!"; |
| 272 } | 272 } |
| 273 | 273 |
| 274 #endif // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) | 274 #endif // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) |
| 275 | 275 |
| 276 } // namespace debug | 276 } // namespace debug |
| 277 } // namespace base | 277 } // namespace base |
| OLD | NEW |