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

Unified Diff: base/debug/stack_trace_win.cc

Issue 7763008: Disable frame pointer optimization on base::debug::StackTrace() so it works properly in release b... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | content/plugin/npobject_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_win.cc
===================================================================
--- base/debug/stack_trace_win.cc (revision 98490)
+++ base/debug/stack_trace_win.cc (working copy)
@@ -135,11 +135,24 @@
} // namespace
+// Disable optimizations for the StackTrace::StackTrace function. It is
+// important to disable at least frame pointer optimization ("y"), since
+// that breaks CaptureStackBackTrace() and prevents StackTrace from working
+// in Release builds (it may still be janky if other frames are using FPO,
+// but at least it will make it further).
+#if defined(COMPILER_MSVC)
+#pragma optimize("", off)
+#endif
+
StackTrace::StackTrace() {
// When walking our own stack, use CaptureStackBackTrace().
count_ = CaptureStackBackTrace(0, arraysize(trace_), trace_, NULL);
}
+#if defined(COMPILER_MSVC)
+#pragma optimize("", on)
+#endif
+
StackTrace::StackTrace(EXCEPTION_POINTERS* exception_pointers) {
// When walking an exception stack, we need to use StackWalk64().
count_ = 0;
« no previous file with comments | « no previous file | content/plugin/npobject_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698