OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This module contains the necessary code to register the Breakpad exception | 5 // This module contains the necessary code to register the Breakpad exception |
6 // handler. This implementation is based on Chrome/Chrome Frame crash reporting | 6 // handler. This implementation is based on Chrome/Chrome Frame crash reporting |
7 // code. See: | 7 // code. See: |
8 // - src/chrome/app/breakpad_win.cc | 8 // - src/chrome/app/breakpad_win.cc |
9 // - src/chrome_frame/crash_server_init.cc | 9 // - src/chrome_frame/crash_server_init.cc |
10 // - src/chrome/installer/setup/setup_main.cc | 10 // - src/chrome/installer/setup/setup_main.cc |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 _CrtSetReportMode(_CRT_ASSERT, 0); | 105 _CrtSetReportMode(_CRT_ASSERT, 0); |
106 | 106 |
107 // Get the alternate dump directory. We use the temp path. | 107 // Get the alternate dump directory. We use the temp path. |
108 // N.B. We don't use base::GetTempDir() here to avoid running more code then | 108 // N.B. We don't use base::GetTempDir() here to avoid running more code then |
109 // necessary before crashes can be properly reported. | 109 // necessary before crashes can be properly reported. |
110 wchar_t temp_directory[MAX_PATH + 1] = { 0 }; | 110 wchar_t temp_directory[MAX_PATH + 1] = { 0 }; |
111 DWORD length = GetTempPath(MAX_PATH, temp_directory); | 111 DWORD length = GetTempPath(MAX_PATH, temp_directory); |
112 if (length == 0) | 112 if (length == 0) |
113 return; | 113 return; |
114 | 114 |
115 // Minidump with stacks, PEB, TEB, unloaded module list and memory referenced | 115 // Minidump with stacks, PEB, TEBs and unloaded module list. |
116 // from stack. | |
117 MINIDUMP_TYPE dump_type = static_cast<MINIDUMP_TYPE>( | 116 MINIDUMP_TYPE dump_type = static_cast<MINIDUMP_TYPE>( |
118 MiniDumpWithProcessThreadData | | 117 MiniDumpWithProcessThreadData | |
119 MiniDumpWithUnloadedModules | | 118 MiniDumpWithUnloadedModules); |
120 MiniDumpWithIndirectlyReferencedMemory); | |
121 breakpad_.reset( | 119 breakpad_.reset( |
122 new google_breakpad::ExceptionHandler( | 120 new google_breakpad::ExceptionHandler( |
123 temp_directory, &OnExceptionCallback, NULL, NULL, | 121 temp_directory, &OnExceptionCallback, NULL, NULL, |
124 google_breakpad::ExceptionHandler::HANDLER_ALL, dump_type, | 122 google_breakpad::ExceptionHandler::HANDLER_ALL, dump_type, |
125 pipe_name_, GetCustomInfo())); | 123 pipe_name_, GetCustomInfo())); |
126 | 124 |
127 if (breakpad_->IsOutOfProcess()) { | 125 if (breakpad_->IsOutOfProcess()) { |
128 // Tells breakpad to handle breakpoint and single step exceptions. | 126 // Tells breakpad to handle breakpoint and single step exceptions. |
129 breakpad_->set_handle_debug_exceptions(true); | 127 breakpad_->set_handle_debug_exceptions(true); |
130 } | 128 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Touch the object to make sure it is initialized. | 203 // Touch the object to make sure it is initialized. |
206 BreakpadWin::GetInstance(); | 204 BreakpadWin::GetInstance(); |
207 } | 205 } |
208 | 206 |
209 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { | 207 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { |
210 BreakpadWin::pipe_name_ = pipe_name; | 208 BreakpadWin::pipe_name_ = pipe_name; |
211 InitializeCrashReporting(); | 209 InitializeCrashReporting(); |
212 } | 210 } |
213 | 211 |
214 } // namespace remoting | 212 } // namespace remoting |
OLD | NEW |