Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/platform/crash/crash_reporter.cc

Issue 2121012: Simplify libcrash_dumper interface and make window_manager gen crash dumps (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: Change crash dumper lib name Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform/crash/crash_dumper.cc ('k') | src/platform/window_manager/SConstruct » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <string> 5 #include <string>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "crash/system_logging.h" 10 #include "crash/system_logging.h"
11 #include "crash/user_collector.h" 11 #include "crash/user_collector.h"
12 #include "gflags/gflags.h" 12 #include "gflags/gflags.h"
13 #include "metrics/metrics_library.h" 13 #include "metrics/metrics_library.h"
14 14
15 #pragma GCC diagnostic ignored "-Wstrict-aliasing" 15 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
16 DEFINE_bool(init, false, "Initialize crash logging"); 16 DEFINE_bool(init, false, "Initialize crash logging");
17 DEFINE_bool(clean_shutdown, false, "Signal clean shutdown"); 17 DEFINE_bool(clean_shutdown, false, "Signal clean shutdown");
18 DEFINE_bool(crash_test, false, "Crash test");
18 DEFINE_string(exec, "", "Executable name crashed"); 19 DEFINE_string(exec, "", "Executable name crashed");
19 DEFINE_int32(pid, -1, "Crashing PID"); 20 DEFINE_int32(pid, -1, "Crashing PID");
20 DEFINE_int32(signal, -1, "Signal causing crash"); 21 DEFINE_int32(signal, -1, "Signal causing crash");
21 DEFINE_bool(unclean_check, true, "Check for unclean shutdown"); 22 DEFINE_bool(unclean_check, true, "Check for unclean shutdown");
22 #pragma GCC diagnostic error "-Wstrict-aliasing" 23 #pragma GCC diagnostic error "-Wstrict-aliasing"
23 24
24 static const char kCrashCounterHistogram[] = "Logging.CrashCounter"; 25 static const char kCrashCounterHistogram[] = "Logging.CrashCounter";
25 static const char kUncleanShutdownFile[] = 26 static const char kUncleanShutdownFile[] =
26 "/var/lib/crash_reporter/pending_clean_shutdown"; 27 "/var/lib/crash_reporter/pending_clean_shutdown";
27 28
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 SignalCleanShutdown(); 107 SignalCleanShutdown();
107 user_collector.Disable(); 108 user_collector.Disable();
108 return 0; 109 return 0;
109 } 110 }
110 111
111 // Handle a specific user space crash. 112 // Handle a specific user space crash.
112 CHECK(FLAGS_signal != -1) << "Signal must be set"; 113 CHECK(FLAGS_signal != -1) << "Signal must be set";
113 CHECK(FLAGS_pid != -1) << "PID must be set"; 114 CHECK(FLAGS_pid != -1) << "PID must be set";
114 CHECK(FLAGS_exec != "") << "Executable name must be set"; 115 CHECK(FLAGS_exec != "") << "Executable name must be set";
115 116
117 // Make it possible to test what happens when we crash while
118 // handling a crash.
119 if (FLAGS_crash_test) {
120 *(char *)0 = 0;
121 return 0;
122 }
123
116 user_collector.HandleCrash(FLAGS_signal, FLAGS_pid, FLAGS_exec); 124 user_collector.HandleCrash(FLAGS_signal, FLAGS_pid, FLAGS_exec);
117 125
118 return 0; 126 return 0;
119 } 127 }
OLDNEW
« no previous file with comments | « src/platform/crash/crash_dumper.cc ('k') | src/platform/window_manager/SConstruct » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698