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 #include "chrome/browser/crash_handler_host_linux.h" | 5 #include "chrome/browser/crash_handler_host_linux.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/syscall.h> | 10 #include <sys/syscall.h> |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (!info->upload) | 374 if (!info->upload) |
375 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); | 375 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); |
376 const uint64 rand = base::RandUint64(); | 376 const uint64 rand = base::RandUint64(); |
377 const std::string minidump_filename = | 377 const std::string minidump_filename = |
378 base::StringPrintf("%s/chromium-%s-minidump-%016" PRIx64 ".dmp", | 378 base::StringPrintf("%s/chromium-%s-minidump-%016" PRIx64 ".dmp", |
379 dumps_path.value().c_str(), | 379 dumps_path.value().c_str(), |
380 process_type_.c_str(), | 380 process_type_.c_str(), |
381 rand); | 381 rand); |
382 | 382 |
383 if (!google_breakpad::WriteMinidump(minidump_filename.c_str(), | 383 if (!google_breakpad::WriteMinidump(minidump_filename.c_str(), |
| 384 kMaxMinidumpFileSize, |
384 crashing_pid, crash_context, | 385 crashing_pid, crash_context, |
385 kCrashContextSize)) { | 386 kCrashContextSize, |
| 387 google_breakpad::MappingList(), |
| 388 google_breakpad::AppMemoryList())) { |
386 LOG(ERROR) << "Failed to write crash dump for pid " << crashing_pid; | 389 LOG(ERROR) << "Failed to write crash dump for pid " << crashing_pid; |
387 } | 390 } |
388 #if defined(ADDRESS_SANITIZER) | 391 #if defined(ADDRESS_SANITIZER) |
389 // Create a temporary file holding the AddressSanitizer report. | 392 // Create a temporary file holding the AddressSanitizer report. |
390 const std::string log_filename = | 393 const std::string log_filename = |
391 base::StringPrintf("%s/chromium-%s-minidump-%016" PRIx64 ".log", | 394 base::StringPrintf("%s/chromium-%s-minidump-%016" PRIx64 ".log", |
392 dumps_path.value().c_str(), | 395 dumps_path.value().c_str(), |
393 process_type_.c_str(), | 396 process_type_.c_str(), |
394 rand); | 397 rand); |
395 FILE* logfile = fopen(log_filename.c_str(), "w"); | 398 FILE* logfile = fopen(log_filename.c_str(), "w"); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 530 } |
528 | 531 |
529 void RendererCrashHandlerHostLinux::SetProcessType() { | 532 void RendererCrashHandlerHostLinux::SetProcessType() { |
530 process_type_ = "renderer"; | 533 process_type_ = "renderer"; |
531 } | 534 } |
532 | 535 |
533 // static | 536 // static |
534 RendererCrashHandlerHostLinux* RendererCrashHandlerHostLinux::GetInstance() { | 537 RendererCrashHandlerHostLinux* RendererCrashHandlerHostLinux::GetInstance() { |
535 return Singleton<RendererCrashHandlerHostLinux>::get(); | 538 return Singleton<RendererCrashHandlerHostLinux>::get(); |
536 } | 539 } |
OLD | NEW |