OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 } else { | 150 } else { |
151 std::string pipe_name_utf8; | 151 std::string pipe_name_utf8; |
152 if (env->GetVar(kPipeNameVar, &pipe_name_utf8)) { | 152 if (env->GetVar(kPipeNameVar, &pipe_name_utf8)) { |
153 GetCrashpadClient().SetHandlerIPCPipe(base::UTF8ToUTF16(pipe_name_utf8)); | 153 GetCrashpadClient().SetHandlerIPCPipe(base::UTF8ToUTF16(pipe_name_utf8)); |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 return database_path; | 157 return database_path; |
158 } | 158 } |
159 | 159 |
160 // TODO(scottmg): http://crbug.com/546288 These exported functions are for | |
161 // compatibility with how Breakpad worked, but it seems like there's no need to | |
162 // do the CreateRemoteThread() dance with a minor extension of the Crashpad API | |
163 // (to just pass the pid we want a dump for). We should add that and then modify | |
164 // hang_crash_dump_win.cc to work in a more direct manner. | |
165 | |
166 // Used for dumping a process state when there is no crash. | |
167 extern "C" void __declspec(dllexport) __cdecl DumpProcessWithoutCrash() { | |
168 CRASHPAD_SIMULATE_CRASH(); | |
169 } | |
170 | |
171 namespace { | 160 namespace { |
172 | 161 |
162 void DumpProcessWithoutCrash() { | |
Will Harris
2017/05/26 05:54:38
not sure why we have two copies of this function..
scottmg
2017/06/13 17:47:55
It looks like https://cs.chromium.org/chromium/src
Will Harris
2017/06/13 19:03:59
sigh - does hang monitor have any tests...? :S
Will Harris
2017/06/15 22:54:38
Done, the call was removed in another CL.
| |
163 CRASHPAD_SIMULATE_CRASH(); | |
164 } | |
165 | |
173 // We need to prevent ICF from folding DumpForHangDebuggingThread(), | 166 // We need to prevent ICF from folding DumpForHangDebuggingThread(), |
174 // DumpProcessForHungInputThread(), DumpProcessForHungInputNoCrashKeysThread() | 167 // DumpProcessForHungInputThread(), DumpProcessForHungInputNoCrashKeysThread() |
175 // and DumpProcessWithoutCrashThread() together, since that makes them | 168 // and DumpProcessWithoutCrashThread() together, since that makes them |
176 // indistinguishable in crash dumps. We do this by making the function | 169 // indistinguishable in crash dumps. We do this by making the function |
177 // bodies unique, and prevent optimization from shuffling things around. | 170 // bodies unique, and prevent optimization from shuffling things around. |
178 MSVC_DISABLE_OPTIMIZE() | 171 MSVC_DISABLE_OPTIMIZE() |
179 MSVC_PUSH_DISABLE_WARNING(4748) | 172 MSVC_PUSH_DISABLE_WARNING(4748) |
180 | 173 |
181 // Note that this function must be in a namespace for the [Renderer hang] | 174 // Note that this function must be in a namespace for the [Renderer hang] |
182 // annotations to work on the crash server. | 175 // annotations to work on the crash server. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 355 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
363 void* start) { | 356 void* start) { |
364 ExceptionHandlerRecord* record = | 357 ExceptionHandlerRecord* record = |
365 reinterpret_cast<ExceptionHandlerRecord*>(start); | 358 reinterpret_cast<ExceptionHandlerRecord*>(start); |
366 | 359 |
367 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 360 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
368 } | 361 } |
369 #endif // ARCH_CPU_X86_64 | 362 #endif // ARCH_CPU_X86_64 |
370 | 363 |
371 } // extern "C" | 364 } // extern "C" |
OLD | NEW |