summaryrefslogtreecommitdiffstats
path: root/chrome_frame/crash_reporting
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 20:13:33 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 20:13:33 +0000
commit1351063c04b28ac249d08aedf0ec63c9096b77cd (patch)
tree6b917795b8f356a264069ea9d5ed0ef53653c45a /chrome_frame/crash_reporting
parentaa834dc6a1c117765cae43f6b6be2ab44bf8895c (diff)
downloadchromium_src-1351063c04b28ac249d08aedf0ec63c9096b77cd.zip
chromium_src-1351063c04b28ac249d08aedf0ec63c9096b77cd.tar.gz
chromium_src-1351063c04b28ac249d08aedf0ec63c9096b77cd.tar.bz2
Omit FPO so ::RtlCaptureStackBackTrace is more reliable in Release build for the unittests.
Review URL: http://codereview.chromium.org/566010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/crash_reporting')
-rw-r--r--chrome_frame/crash_reporting/crash_report.cc4
-rw-r--r--chrome_frame/crash_reporting/veh_test.cc9
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome_frame/crash_reporting/crash_report.cc b/chrome_frame/crash_reporting/crash_report.cc
index 7c2302b..1f1041e 100644
--- a/chrome_frame/crash_reporting/crash_report.cc
+++ b/chrome_frame/crash_reporting/crash_report.cc
@@ -69,10 +69,14 @@ class CrashHandler {
static CrashHandler g_crash_handler;
+// Turn off FPO optimization, so ::RtlCaptureStackBackTrace returns sane result.
+#pragma optimize("y", off)
LONG WINAPI CrashHandler::VectoredHandlerEntryPoint(
EXCEPTION_POINTERS* exptrs) {
return g_crash_handler.handler_.Handler(exptrs);
}
+#pragma optimize("y", on)
+
#pragma code_seg(pop)
bool CrashHandler::Init(google_breakpad::ExceptionHandler* breakpad) {
diff --git a/chrome_frame/crash_reporting/veh_test.cc b/chrome_frame/crash_reporting/veh_test.cc
index 7f844e9..bfdb788 100644
--- a/chrome_frame/crash_reporting/veh_test.cc
+++ b/chrome_frame/crash_reporting/veh_test.cc
@@ -13,7 +13,7 @@ static void ModuleStart() {}
#pragma code_seg(pop)
#pragma code_seg(push, ".m$_2")
-static void Undetectable(DWORD code) {
+DECLSPEC_NOINLINE static void Undetectable(DWORD code) {
__try {
::RaiseException(code, 0, 0, NULL);
} __except(EXCEPTION_EXECUTE_HANDLER) {
@@ -27,7 +27,7 @@ static void UndetectableEnd() {}
#pragma code_seg(pop)
#pragma code_seg(push, ".m$_4")
-static void CatchThis() {
+DECLSPEC_NOINLINE static void CatchThis() {
__try {
::RaiseException(STATUS_ACCESS_VIOLATION, 0, 0, NULL);
} __except(EXCEPTION_EXECUTE_HANDLER) {
@@ -37,7 +37,6 @@ static void CatchThis() {
// this will be detected since we are on the stack!
Undetectable(STATUS_ILLEGAL_INSTRUCTION);
}
-
#pragma code_seg(pop)
#pragma code_seg(push, ".m$_9")
@@ -67,10 +66,12 @@ class MockApi : public Win32VEHTraits,
typedef VectoredHandlerT<MockApi> VectoredHandlerMock;
+#pragma optimize("y", off)
static VectoredHandlerMock* g_mock_veh = NULL;
static LONG WINAPI VEH(EXCEPTION_POINTERS* exptrs) {
return g_mock_veh->Handler(exptrs);
}
+#pragma optimize("y", on)
TEST(ChromeFrame, ExceptionExcludedCode) {
MockApi api;
@@ -100,5 +101,3 @@ TEST(ChromeFrame, ExceptionExcludedCode) {
::RemoveVectoredExceptionHandler(id);
g_mock_veh = NULL;
}
-
-