| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 return depth; | 257 return depth; |
| 258 } | 258 } |
| 259 | 259 |
| 260 ScopedStackFrameLinker::ScopedStackFrameLinker(void* fp, void* parent_fp) | 260 ScopedStackFrameLinker::ScopedStackFrameLinker(void* fp, void* parent_fp) |
| 261 : fp_(fp), | 261 : fp_(fp), |
| 262 parent_fp_(parent_fp), | 262 parent_fp_(parent_fp), |
| 263 original_parent_fp_(LinkStackFrames(fp, parent_fp)) {} | 263 original_parent_fp_(LinkStackFrames(fp, parent_fp)) {} |
| 264 | 264 |
| 265 ScopedStackFrameLinker::~ScopedStackFrameLinker() { | 265 ScopedStackFrameLinker::~ScopedStackFrameLinker() { |
| 266 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); | 266 void* previous_parent_fp = LinkStackFrames(fp_, original_parent_fp_); |
| 267 CHECK_EQ(parent_fp_, previous_parent_fp) | 267 // Stack frame's parent pointer has changed! |
| 268 << "Stack frame's parent pointer has changed!"; | 268 CHECK_EQ(parent_fp_, previous_parent_fp); |
| 269 } | 269 } |
| 270 | 270 |
| 271 #endif // HAVE_TRACE_STACK_FRAME_POINTERS | 271 #endif // HAVE_TRACE_STACK_FRAME_POINTERS |
| 272 | 272 |
| 273 } // namespace debug | 273 } // namespace debug |
| 274 } // namespace base | 274 } // namespace base |
| OLD | NEW |