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/crash/app/breakpad_linux.h" | 8 #include "components/crash/app/breakpad_linux.h" |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1075 return true; | 1075 return true; |
1076 #endif | 1076 #endif |
1077 } | 1077 } |
1078 | 1078 |
1079 // |buf| should be |expected_len| + 1 characters in size and NULL terminated. | 1079 // |buf| should be |expected_len| + 1 characters in size and NULL terminated. |
1080 void HandleCrashReportId(const char* buf, size_t bytes_read, | 1080 void HandleCrashReportId(const char* buf, size_t bytes_read, |
1081 size_t expected_len) { | 1081 size_t expected_len) { |
1082 WriteNewline(); | 1082 WriteNewline(); |
1083 if (!IsValidCrashReportId(buf, bytes_read, expected_len)) { | 1083 if (!IsValidCrashReportId(buf, bytes_read, expected_len)) { |
1084 #if defined(OS_CHROMEOS) | 1084 #if defined(OS_CHROMEOS) |
1085 static const char msg[] = "Crash_reporter failed to process crash report"; | 1085 static const char msg[] = "Crash_reporter failed to process crash report"; |
vapier
2014/09/19 16:14:23
might rephrase this to:
system crash-reporter fa
Lei Zhang
2014/09/19 18:26:09
Done.
| |
1086 #else | 1086 #else |
1087 static const char msg[] = "Failed to get crash dump id."; | 1087 static const char msg[] = "Failed to get crash dump id."; |
1088 #endif | 1088 #endif |
1089 WriteLog(msg, sizeof(msg) - 1); | 1089 WriteLog(msg, sizeof(msg) - 1); |
1090 WriteNewline(); | 1090 WriteNewline(); |
1091 | |
1092 static const char id_msg[] = "Report Id: "; | |
1093 WriteLog(id_msg, sizeof(id_msg) - 1); | |
1094 WriteLog(buf, bytes_read); | |
1095 WriteNewline(); | |
1091 return; | 1096 return; |
1092 } | 1097 } |
1093 | 1098 |
1094 #if defined(OS_CHROMEOS) | 1099 #if defined(OS_CHROMEOS) |
1095 static const char msg[] = "Crash dump received by crash_reporter\n"; | 1100 static const char msg[] = "Crash dump received by crash_reporter\n"; |
1096 WriteLog(msg, sizeof(msg) - 1); | 1101 WriteLog(msg, sizeof(msg) - 1); |
1097 #else | 1102 #else |
1098 // Write crash dump id to stderr. | 1103 // Write crash dump id to stderr. |
1099 static const char msg[] = "Crash dump id: "; | 1104 static const char msg[] = "Crash dump id: "; |
1100 WriteLog(msg, sizeof(msg) - 1); | 1105 WriteLog(msg, sizeof(msg) - 1); |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1608 } | 1613 } |
1609 } | 1614 } |
1610 } | 1615 } |
1611 #endif // OS_ANDROID | 1616 #endif // OS_ANDROID |
1612 | 1617 |
1613 bool IsCrashReporterEnabled() { | 1618 bool IsCrashReporterEnabled() { |
1614 return g_is_crash_reporter_enabled; | 1619 return g_is_crash_reporter_enabled; |
1615 } | 1620 } |
1616 | 1621 |
1617 } // namespace breakpad | 1622 } // namespace breakpad |
OLD | NEW |