Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2813)

Unified Diff: base/debug/stack_trace.cc

Issue 2757123002: Cleaner fall-back stack capture for --enable-heap-profiling=native. (Closed)
Patch Set: Revert to non-function-style macro Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/debug/stack_trace.cc
diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
index 43a23d95ac10ba0ca270a654cf1525a59b55ab58..af4a6efc3ed2f60f3b7a04b2f592e9e886726dfc 100644
--- a/base/debug/stack_trace.cc
+++ b/base/debug/stack_trace.cc
@@ -35,7 +35,7 @@ namespace debug {
namespace {
-#if HAVE_TRACE_STACK_FRAME_POINTERS && !defined(OS_WIN)
+#if HAVE_TRACE_STACK_FRAME_POINTERS
#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__)
// GCC and LLVM generate slightly different frames on ARM, see
@@ -142,7 +142,7 @@ void* LinkStackFrames(void* fpp, void* parent_fp) {
return prev_parent_fp;
}
-#endif // HAVE_TRACE_STACK_FRAME_POINTERS && !defined(OS_WIN)
+#endif // HAVE_TRACE_STACK_FRAME_POINTERS
} // namespace
@@ -225,18 +225,6 @@ std::string StackTrace::ToString() const {
size_t TraceStackFramePointers(const void** out_trace,
size_t max_depth,
size_t skip_initial) {
-// TODO(699863): Merge the frame-pointer based stack unwinder into the
-// base::debug::StackTrace platform-specific implementation files.
-#if defined(OS_WIN)
- StackTrace stack(max_depth);
- size_t count = 0;
- const void* const* frames = stack.Addresses(&count);
- if (count < skip_initial)
- return 0u;
- count -= skip_initial;
- memcpy(out_trace, frames + skip_initial, count * sizeof(void*));
- return count;
-#elif defined(OS_POSIX)
// Usage of __builtin_frame_address() enables frame pointers in this
// function even if they are not enabled globally. So 'fp' will always
// be valid.
@@ -270,10 +258,8 @@ size_t TraceStackFramePointers(const void** out_trace,
}
return depth;
-#endif
}
-#if !defined(OS_WIN)
ScopedStackFrameLinker::ScopedStackFrameLinker(void* fp, void* parent_fp)
: fp_(fp),
parent_fp_(parent_fp),
@@ -284,7 +270,6 @@ ScopedStackFrameLinker::~ScopedStackFrameLinker() {
CHECK_EQ(parent_fp_, previous_parent_fp)
<< "Stack frame's parent pointer has changed!";
}
-#endif // !defined(OS_WIN)
#endif // HAVE_TRACE_STACK_FRAME_POINTERS

Powered by Google App Engine
This is Rietveld 408576698