OLD | NEW |
1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, | 62 bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, |
63 DWORD process_id, | 63 DWORD process_id, |
64 DWORD thread_id, | 64 DWORD thread_id, |
65 DWORD requesting_thread_id, | 65 DWORD requesting_thread_id, |
66 EXCEPTION_POINTERS* exception_pointers, | 66 EXCEPTION_POINTERS* exception_pointers, |
67 MDRawAssertionInfo* assert_info, | 67 MDRawAssertionInfo* assert_info, |
68 MINIDUMP_TYPE dump_type, | 68 MINIDUMP_TYPE dump_type, |
69 bool is_client_pointers, | 69 bool is_client_pointers, |
70 wstring* dump_path) { | 70 wstring* dump_path) { |
| 71 // Just call the full WriteMinidump with NULL as the full_dump_path. |
| 72 return this->WriteMinidump(process_handle, process_id, thread_id, |
| 73 requesting_thread_id, exception_pointers, |
| 74 assert_info, dump_type, is_client_pointers, |
| 75 dump_path, NULL); |
| 76 } |
| 77 |
| 78 bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, |
| 79 DWORD process_id, |
| 80 DWORD thread_id, |
| 81 DWORD requesting_thread_id, |
| 82 EXCEPTION_POINTERS* exception_pointers, |
| 83 MDRawAssertionInfo* assert_info, |
| 84 MINIDUMP_TYPE dump_type, |
| 85 bool is_client_pointers, |
| 86 wstring* dump_path, |
| 87 wstring* full_dump_path) { |
71 MiniDumpWriteDumpType write_dump = GetWriteDump(); | 88 MiniDumpWriteDumpType write_dump = GetWriteDump(); |
72 if (!write_dump) { | 89 if (!write_dump) { |
73 return false; | 90 return false; |
74 } | 91 } |
75 | 92 |
76 wstring dump_file_path; | 93 wstring dump_file_path; |
77 if (!GenerateDumpFilePath(&dump_file_path)) { | 94 if (!GenerateDumpFilePath(&dump_file_path)) { |
78 return false; | 95 return false; |
79 } | 96 } |
80 | 97 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 233 |
217 CloseHandle(dump_file); | 234 CloseHandle(dump_file); |
218 if (full_dump_file != INVALID_HANDLE_VALUE) | 235 if (full_dump_file != INVALID_HANDLE_VALUE) |
219 CloseHandle(full_dump_file); | 236 CloseHandle(full_dump_file); |
220 | 237 |
221 // Store the path of the dump file in the out parameter if dump generation | 238 // Store the path of the dump file in the out parameter if dump generation |
222 // succeeded. | 239 // succeeded. |
223 if (result && dump_path) { | 240 if (result && dump_path) { |
224 *dump_path = dump_file_path; | 241 *dump_path = dump_file_path; |
225 } | 242 } |
| 243 if (result && full_memory_dump && full_dump_path) { |
| 244 *full_dump_path = full_dump_file_path; |
| 245 } |
226 | 246 |
227 return result; | 247 return result; |
228 } | 248 } |
229 | 249 |
230 HMODULE MinidumpGenerator::GetDbghelpModule() { | 250 HMODULE MinidumpGenerator::GetDbghelpModule() { |
231 AutoCriticalSection lock(&module_load_sync_); | 251 AutoCriticalSection lock(&module_load_sync_); |
232 if (!dbghelp_module_) { | 252 if (!dbghelp_module_) { |
233 dbghelp_module_ = LoadLibrary(TEXT("dbghelp.dll")); | 253 dbghelp_module_ = LoadLibrary(TEXT("dbghelp.dll")); |
234 } | 254 } |
235 | 255 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 288 } |
269 } | 289 } |
270 | 290 |
271 return create_uuid_; | 291 return create_uuid_; |
272 } | 292 } |
273 | 293 |
274 bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) { | 294 bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) { |
275 UUID id = {0}; | 295 UUID id = {0}; |
276 | 296 |
277 UuidCreateType create_uuid = GetCreateUuid(); | 297 UuidCreateType create_uuid = GetCreateUuid(); |
278 if(!create_uuid) { | 298 if (!create_uuid) { |
279 return false; | 299 return false; |
280 } | 300 } |
281 | 301 |
282 create_uuid(&id); | 302 create_uuid(&id); |
283 wstring id_str = GUIDString::GUIDToWString(&id); | 303 wstring id_str = GUIDString::GUIDToWString(&id); |
284 | 304 |
285 *file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp"); | 305 *file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp"); |
286 return true; | 306 return true; |
287 } | 307 } |
288 | 308 |
289 } // namespace google_breakpad | 309 } // namespace google_breakpad |
OLD | NEW |