summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 01:12:12 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 01:12:12 +0000
commit2149cc62fd9464cf80b427c0acd022ff5d7b03b5 (patch)
tree9da50d5c466a5f52d00aa94e9319870b40011cc6
parent00cd54b939d7498ddc2e5ae355a03250f13b35d7 (diff)
downloadchromium_src-2149cc62fd9464cf80b427c0acd022ff5d7b03b5.zip
chromium_src-2149cc62fd9464cf80b427c0acd022ff5d7b03b5.tar.gz
chromium_src-2149cc62fd9464cf80b427c0acd022ff5d7b03b5.tar.bz2
Add a stackframe named 'CrashIntentionally' to crashes from about:crash.
This should make it easier to categorize on the crash server. BUG=113231 Review URL: http://codereview.chromium.org/9380026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121798 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/compiler_specific.h13
-rw-r--r--content/renderer/render_view_impl.cc16
2 files changed, 19 insertions, 10 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 99c38ce..0d93460 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -90,9 +90,18 @@
// int x ALLOW_UNUSED = ...;
#if defined(COMPILER_GCC)
#define ALLOW_UNUSED __attribute__((unused))
-#define NOINLINE __attribute__((noinline))
#else
#define ALLOW_UNUSED
+#endif
+
+// Annotate a function indicating it should not be inlined.
+// Use like:
+// NOINLINE void DoStuff() { ... }
+#if defined(COMPILER_GCC)
+#define NOINLINE __attribute__((noinline))
+#elif defined(COMPILER_MSVC)
+#define NOINLINE __declspec(noinline)
+#else
#define NOINLINE
#endif
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index f246e1b..5ab58f0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -325,18 +325,18 @@ static WebReferrerPolicy getReferrerPolicyFromRequest(
WebKit::WebReferrerPolicyDefault;
}
+NOINLINE static void CrashIntentionally() {
+ // NOTE(shess): Crash directly rather than using NOTREACHED() so
+ // that the signature is easier to triage in crash reports.
+ volatile int* zero = NULL;
+ *zero = 0;
+}
+
static void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(chrome::kChromeUIScheme))
return;
if (url == GURL(chrome::kChromeUICrashURL)) {
- // NOTE(shess): Crash directly rather than using NOTREACHED() so
- // that the signature is easier to triage in crash reports.
- volatile int* zero = NULL;
- *zero = 0;
-
- // Just in case the compiler decides the above is undefined and
- // optimizes it away.
- NOTREACHED();
+ CrashIntentionally();
} else if (url == GURL(chrome::kChromeUIKillURL)) {
base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
} else if (url == GURL(chrome::kChromeUIHangURL)) {