summaryrefslogtreecommitdiffstats
path: root/components/crash
diff options
context:
space:
mode:
authorscottmg <scottmg@chromium.org>2015-12-15 11:06:28 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-15 19:07:58 +0000
commit93ba91139f5a026628dabc9fcdc7b433ec171198 (patch)
tree03db3d2f41bc11699bf0bf844d93e74b441cad16 /components/crash
parentbfc9a7ff24fabd4c011d72016542219040a0649e (diff)
downloadchromium_src-93ba91139f5a026628dabc9fcdc7b433ec171198.zip
chromium_src-93ba91139f5a026628dabc9fcdc7b433ec171198.tar.gz
chromium_src-93ba91139f5a026628dabc9fcdc7b433ec171198.tar.bz2
win: Fix [Renderer hang] annotations after Crashpad
The crash processor looks for "::DumpProcessWithoutCrashThread" to annotate [Renderer hang]s, so putting this function back in an anonymous namespace should fix those annotations. (It was previously in the namespace, but also accidentally inside an extern "C" block.) dump_syms before: "D:\src\cr3\src\breakpad\src\tools\windows\binaries\dump_syms.exe" out\debug\chrome.exe | grep DumpProcessWithoutCrashThread FUNC 42fe0 15 4 DumpProcessWithoutCrashThread dump_syms after: "D:\src\cr3\src\breakpad\src\tools\windows\binaries\dump_syms.exe" out\debug\chrome.exe | grep DumpProcessWithoutCrashThread FUNC 408e0 15 0 crash_reporter::internal::`anonymous namespace'::DumpProcessWithoutCrashThread(void *) R=wfh@chromium.org, rsesek@chromium.org BUG=567264 Review URL: https://codereview.chromium.org/1523953003 Cr-Commit-Position: refs/heads/master@{#365302}
Diffstat (limited to 'components/crash')
-rw-r--r--components/crash/content/app/crashpad_win.cc50
1 files changed, 27 insertions, 23 deletions
diff --git a/components/crash/content/app/crashpad_win.cc b/components/crash/content/app/crashpad_win.cc
index 07c235e..6191da8 100644
--- a/components/crash/content/app/crashpad_win.cc
+++ b/components/crash/content/app/crashpad_win.cc
@@ -99,20 +99,6 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
return database_path;
}
-extern "C" {
-
-// Crashes the process after generating a dump for the provided exception. Note
-// that the crash reporter should be initialized before calling this function
-// for it to do anything.
-// NOTE: This function is used by SyzyASAN to invoke a crash. If you change the
-// the name or signature of this function you will break SyzyASAN instrumented
-// releases of Chrome. Please contact syzygy-team@chromium.org before doing so!
-int __declspec(dllexport) CrashForException(
- EXCEPTION_POINTERS* info) {
- g_crashpad_client.Get().DumpAndCrash(info);
- return EXCEPTION_CONTINUE_SEARCH;
-}
-
// TODO(scottmg): http://crbug.com/546288 These exported functions are for
// compatibility with how Breakpad worked, but it seems like there's no need to
// do the CreateRemoteThread() dance with a minor extension of the Crashpad API
@@ -133,6 +119,8 @@ namespace {
MSVC_DISABLE_OPTIMIZE()
MSVC_PUSH_DISABLE_WARNING(4748)
+// Note that this function must be in a namespace for the [Renderer hang]
+// annotations to work on the crash server.
DWORD WINAPI DumpProcessWithoutCrashThread(void*) {
DumpProcessWithoutCrash();
return 0;
@@ -154,17 +142,36 @@ MSVC_ENABLE_OPTIMIZE()
} // namespace
+} // namespace internal
+} // namespace crash_reporter
+
+extern "C" {
+
+// Crashes the process after generating a dump for the provided exception. Note
+// that the crash reporter should be initialized before calling this function
+// for it to do anything.
+// NOTE: This function is used by SyzyASAN to invoke a crash. If you change the
+// the name or signature of this function you will break SyzyASAN instrumented
+// releases of Chrome. Please contact syzygy-team@chromium.org before doing so!
+int __declspec(dllexport) CrashForException(
+ EXCEPTION_POINTERS* info) {
+ crash_reporter::internal::g_crashpad_client.Get().DumpAndCrash(info);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
// Injects a thread into a remote process to dump state when there is no crash.
-extern "C" HANDLE __declspec(dllexport) __cdecl InjectDumpProcessWithoutCrash(
+HANDLE __declspec(dllexport) __cdecl InjectDumpProcessWithoutCrash(
HANDLE process) {
- return CreateRemoteThread(process, NULL, 0, DumpProcessWithoutCrashThread, 0,
- 0, NULL);
+ return CreateRemoteThread(
+ process, NULL, 0, crash_reporter::internal::DumpProcessWithoutCrashThread,
+ 0, 0, NULL);
}
-extern "C" HANDLE __declspec(dllexport) __cdecl InjectDumpForHangDebugging(
+HANDLE __declspec(dllexport) __cdecl InjectDumpForHangDebugging(
HANDLE process) {
- return CreateRemoteThread(process, NULL, 0, DumpForHangDebuggingThread, 0, 0,
- NULL);
+ return CreateRemoteThread(
+ process, NULL, 0, crash_reporter::internal::DumpForHangDebuggingThread, 0,
+ 0, NULL);
}
#if defined(ARCH_CPU_X86_64)
@@ -251,6 +258,3 @@ void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange(
#endif // ARCH_CPU_X86_64
} // extern "C"
-
-} // namespace internal
-} // namespace crash_reporter