OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // For linux_syscall_support.h. This makes it safe to call embedded system | 5 // For linux_syscall_support.h. This makes it safe to call embedded system |
6 // calls when in seccomp mode. | 6 // calls when in seccomp mode. |
7 | 7 |
8 #include "components/breakpad/app/breakpad_linux.h" | 8 #include "components/breakpad/app/breakpad_linux.h" |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
11 #include <poll.h> | 11 #include <poll.h> |
12 #include <signal.h> | 12 #include <signal.h> |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 #include <sys/socket.h> | 14 #include <sys/socket.h> |
15 #include <sys/time.h> | 15 #include <sys/time.h> |
16 #include <sys/types.h> | 16 #include <sys/types.h> |
17 #include <sys/uio.h> | 17 #include <sys/uio.h> |
18 #include <sys/wait.h> | 18 #include <sys/wait.h> |
19 #include <time.h> | 19 #include <time.h> |
20 #include <unistd.h> | 20 #include <unistd.h> |
21 | 21 |
22 #include <algorithm> | 22 #include <algorithm> |
23 #include <string> | 23 #include <string> |
24 | 24 |
25 #include "base/base_switches.h" | 25 #include "base/base_switches.h" |
26 #include "base/command_line.h" | 26 #include "base/command_line.h" |
27 #include "base/debug/crash_logging.h" | 27 #include "base/debug/crash_logging.h" |
| 28 #include "base/debug/dump_without_crashing.h" |
28 #include "base/files/file_path.h" | 29 #include "base/files/file_path.h" |
29 #include "base/linux_util.h" | 30 #include "base/linux_util.h" |
30 #include "base/path_service.h" | 31 #include "base/path_service.h" |
31 #include "base/platform_file.h" | 32 #include "base/platform_file.h" |
32 #include "base/posix/eintr_wrapper.h" | 33 #include "base/posix/eintr_wrapper.h" |
33 #include "base/posix/global_descriptors.h" | 34 #include "base/posix/global_descriptors.h" |
34 #include "base/process/memory.h" | 35 #include "base/process/memory.h" |
35 #include "base/strings/string_util.h" | 36 #include "base/strings/string_util.h" |
36 #include "breakpad/src/client/linux/handler/exception_handler.h" | 37 #include "breakpad/src/client/linux/handler/exception_handler.h" |
37 #include "breakpad/src/client/linux/minidump_writer/directory_reader.h" | 38 #include "breakpad/src/client/linux/minidump_writer/directory_reader.h" |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 return; | 1480 return; |
1480 SetClientIdFromCommandLine(parsed_command_line); | 1481 SetClientIdFromCommandLine(parsed_command_line); |
1481 EnableNonBrowserCrashDumping(); | 1482 EnableNonBrowserCrashDumping(); |
1482 VLOG(1) << "Non Browser crash dumping enabled for: " << process_type; | 1483 VLOG(1) << "Non Browser crash dumping enabled for: " << process_type; |
1483 #endif // #if defined(OS_ANDROID) | 1484 #endif // #if defined(OS_ANDROID) |
1484 } | 1485 } |
1485 | 1486 |
1486 SetProcessStartTime(); | 1487 SetProcessStartTime(); |
1487 g_pid = getpid(); | 1488 g_pid = getpid(); |
1488 | 1489 |
1489 GetBreakpadClient()->SetDumpWithoutCrashingFunction(&DumpProcess); | 1490 base::debug::SetDumpWithoutCrashingFunction(&DumpProcess); |
1490 #if defined(ADDRESS_SANITIZER) | 1491 #if defined(ADDRESS_SANITIZER) |
1491 // Register the callback for AddressSanitizer error reporting. | 1492 // Register the callback for AddressSanitizer error reporting. |
1492 __asan_set_error_report_callback(AsanLinuxBreakpadCallback); | 1493 __asan_set_error_report_callback(AsanLinuxBreakpadCallback); |
1493 #endif | 1494 #endif |
1494 | 1495 |
1495 g_crash_keys = new CrashKeyStorage; | 1496 g_crash_keys = new CrashKeyStorage; |
1496 GetBreakpadClient()->RegisterCrashKeys(); | 1497 GetBreakpadClient()->RegisterCrashKeys(); |
1497 base::debug::SetCrashKeyReportingFunctions( | 1498 base::debug::SetCrashKeyReportingFunctions( |
1498 &SetCrashKeyValue, &ClearCrashKey); | 1499 &SetCrashKeyValue, &ClearCrashKey); |
1499 } | 1500 } |
(...skipping 14 matching lines...) Expand all Loading... |
1514 } | 1515 } |
1515 } | 1516 } |
1516 } | 1517 } |
1517 #endif // OS_ANDROID | 1518 #endif // OS_ANDROID |
1518 | 1519 |
1519 bool IsCrashReporterEnabled() { | 1520 bool IsCrashReporterEnabled() { |
1520 return g_is_crash_reporter_enabled; | 1521 return g_is_crash_reporter_enabled; |
1521 } | 1522 } |
1522 | 1523 |
1523 } // namespace breakpad | 1524 } // namespace breakpad |
OLD | NEW |