| 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/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 // TODO(scottmg): http://crbug.com/546288 These exported functions are for | 136 // TODO(scottmg): http://crbug.com/546288 These exported functions are for |
| 137 // compatibility with how Breakpad worked, but it seems like there's no need to | 137 // compatibility with how Breakpad worked, but it seems like there's no need to |
| 138 // do the CreateRemoteThread() dance with a minor extension of the Crashpad API | 138 // do the CreateRemoteThread() dance with a minor extension of the Crashpad API |
| 139 // (to just pass the pid we want a dump for). We should add that and then modify | 139 // (to just pass the pid we want a dump for). We should add that and then modify |
| 140 // hang_crash_dump_win.cc to work in a more direct manner. | 140 // hang_crash_dump_win.cc to work in a more direct manner. |
| 141 | 141 |
| 142 // Used for dumping a process state when there is no crash. | 142 // Used for dumping a process state when there is no crash. |
| 143 extern "C" void __declspec(dllexport) __cdecl DumpProcessWithoutCrash() { | 143 extern "C" void __declspec(dllexport) __cdecl DumpProcessWithoutCrash() { |
| 144 CRASHPAD_SIMULATE_CRASH(); | 144 //CRASHPAD_SIMULATE_CRASH(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 namespace { | 147 namespace { |
| 148 | 148 |
| 149 // We need to prevent ICF from folding DumpForHangDebuggingThread() and | 149 // We need to prevent ICF from folding DumpForHangDebuggingThread() and |
| 150 // DumpProcessWithoutCrashThread() together, since that makes them | 150 // DumpProcessWithoutCrashThread() together, since that makes them |
| 151 // indistinguishable in crash dumps. We do this by making the function | 151 // indistinguishable in crash dumps. We do this by making the function |
| 152 // bodies unique, and prevent optimization from shuffling things around. | 152 // bodies unique, and prevent optimization from shuffling things around. |
| 153 MSVC_DISABLE_OPTIMIZE() | 153 MSVC_DISABLE_OPTIMIZE() |
| 154 MSVC_PUSH_DISABLE_WARNING(4748) | 154 MSVC_PUSH_DISABLE_WARNING(4748) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 285 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
| 286 void* start) { | 286 void* start) { |
| 287 ExceptionHandlerRecord* record = | 287 ExceptionHandlerRecord* record = |
| 288 reinterpret_cast<ExceptionHandlerRecord*>(start); | 288 reinterpret_cast<ExceptionHandlerRecord*>(start); |
| 289 | 289 |
| 290 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 290 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
| 291 } | 291 } |
| 292 #endif // ARCH_CPU_X86_64 | 292 #endif // ARCH_CPU_X86_64 |
| 293 | 293 |
| 294 } // extern "C" | 294 } // extern "C" |
| OLD | NEW |