diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-27 02:46:10 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-27 02:46:10 +0000 |
commit | 77a25464cf7ab80f96a486753b99a1276e70d401 (patch) | |
tree | 08c50269b1d78bfd13af1df9e413c697ea08b846 /base/debug | |
parent | 54d768dbbdc71d359966e2f755f04b23e2c0b495 (diff) | |
download | chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.zip chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.tar.gz chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.tar.bz2 |
Disable frame pointer optimization on base::debug::StackTrace() so it works properly in release builds.
Similarly disable optimizations in npobject_stub.cc so base::debug::StackTrace() can recognize more frames (This last de-optimization is only temporary, whereas the change to base::debug::StackTrace is intended to be permanent).
BUG=94179
Review URL: http://codereview.chromium.org/7763008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/stack_trace_win.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/base/debug/stack_trace_win.cc b/base/debug/stack_trace_win.cc index 97376a2..3332979 100644 --- a/base/debug/stack_trace_win.cc +++ b/base/debug/stack_trace_win.cc @@ -135,11 +135,24 @@ class SymbolContext { } // 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; |