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 HAVE_TRACE_STACK_FRAME_POINTERS | 223 #if HAVE_TRACE_STACK_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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); | 283 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); |
284 CHECK_EQ(parent_fp_, previous_parent_fp) | 284 CHECK_EQ(parent_fp_, previous_parent_fp) |
285 << "Stack frame's parent pointer has changed!"; | 285 << "Stack frame's parent pointer has changed!"; |
286 } | 286 } |
287 #endif // !defined(OS_WIN) | 287 #endif // !defined(OS_WIN) |
288 | 288 |
289 #endif // HAVE_TRACE_STACK_FRAME_POINTERS | 289 #endif // HAVE_TRACE_STACK_FRAME_POINTERS |
290 | 290 |
291 } // namespace debug | 291 } // namespace debug |
292 } // namespace base | 292 } // namespace base |
OLD | NEW |