aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-16 13:19:00 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-17 13:59:57 +0200
commit09454fe361ff757b0207f25b270389a8a60605f6 (patch)
tree5ac282e5ed379bb24067613314ed7792dd829b35 /src/qml/qml/v4
parenta62e32cae6606db64632e418262ab01e7806480c (diff)
Fix JavaScript stack back trace generation in release builds on Windows
We need to be able to reliably generate stack back traces for JavaScript calls, and since we use the C stack we therefore need to be able to reliably walk the stack. On most platforms the stack back trace generation is tied to the same mechanism that's used to unwind the stack during exception handling, which uses compiler generated per-function tables that allow the run-time to unwind the stack even when no regular stack frame was created. Unfortunately on i386 on Windows there are no unwinding tables in use (as opposed to all other architectures Windows runs on), and therefore we have no reliable way of generating a stack back trace if functions can omit the generation of a stack frame. Therefore we have to disable this compiler optimization, using -Oy- for MSVC (see http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.71).aspx ) and -fno-omit-frame-pointer for gcc. Technically this change needs to be done only in places where we support throwing or catching V4 exception as well as code that is traversed during the unwinding. Due to the use of internal V4 api throughout the entire module, this patch is applied to .qmake.conf. This also fixes tst_qqmlvaluetypes Change-Id: I21a9e5522741446de25a5d0046f7e34f741f7722 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/qml/qml/v4')
-rw-r--r--src/qml/qml/v4/qv4stacktrace.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/qml/qml/v4/qv4stacktrace.cpp b/src/qml/qml/v4/qv4stacktrace.cpp
index a96824e420..1cc2e53556 100644
--- a/src/qml/qml/v4/qv4stacktrace.cpp
+++ b/src/qml/qml/v4/qv4stacktrace.cpp
@@ -54,19 +54,6 @@
#include <execinfo.h>
#endif
-#if defined(Q_OS_WIN)
-// We call RtlCaptureContext and that will crash if the compiler did not
-// create a stack frame for the function that calls RtlCaptureContext.
-#if defined(Q_CC_MSVC)
-#pragma optimize( "y", off )
-#elif defined(Q_CC_GNU)
-#pragma GCC optimize ("O0")
-#else
-#error "Don't know how to disable frame pointer optimizations with this compiler on Windows!"
-#endif
-
-#endif
-
QT_BEGIN_NAMESPACE
using namespace QV4;