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

Side by Side Diff: crash_reporter.cc

Issue 6480009: crash-reporter: when exe symlink read fails send diags and still ignore chrome crashes (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crash-reporter.git@master
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | user_collector.h » ('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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Handle a specific user space crash. 141 // Handle a specific user space crash.
142 CHECK(!FLAGS_user.empty()) << "--user= must be set"; 142 CHECK(!FLAGS_user.empty()) << "--user= must be set";
143 143
144 // Make it possible to test what happens when we crash while 144 // Make it possible to test what happens when we crash while
145 // handling a crash. 145 // handling a crash.
146 if (FLAGS_crash_test) { 146 if (FLAGS_crash_test) {
147 *(char *)0 = 0; 147 *(char *)0 = 0;
148 return 0; 148 return 0;
149 } 149 }
150 150
151 // Accumulate logs to help in diagnosing failures during user collection.
152 s_system_log.set_accumulating(true);
151 // Handle the crash, get the name of the process from procfs. 153 // Handle the crash, get the name of the process from procfs.
152 if (!user_collector->HandleCrash(FLAGS_user, NULL)) { 154 bool handled = user_collector->HandleCrash(FLAGS_user, NULL);
155 s_system_log.set_accumulating(false);
156 if (!handled)
153 return 1; 157 return 1;
154 }
155 return 0; 158 return 0;
156 } 159 }
157 160
158 // Interactive/diagnostics mode for generating kernel crash signatures. 161 // Interactive/diagnostics mode for generating kernel crash signatures.
159 static int GenerateKernelSignature(KernelCollector *kernel_collector) { 162 static int GenerateKernelSignature(KernelCollector *kernel_collector) {
160 std::string kcrash_contents; 163 std::string kcrash_contents;
161 std::string signature; 164 std::string signature;
162 if (!file_util::ReadFileToString(FilePath(FLAGS_generate_kernel_signature), 165 if (!file_util::ReadFileToString(FilePath(FLAGS_generate_kernel_signature),
163 &kcrash_contents)) { 166 &kcrash_contents)) {
164 fprintf(stderr, "Could not read file.\n"); 167 fprintf(stderr, "Could not read file.\n");
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 user_collector.Disable(); 215 user_collector.Disable();
213 return 0; 216 return 0;
214 } 217 }
215 218
216 if (!FLAGS_generate_kernel_signature.empty()) { 219 if (!FLAGS_generate_kernel_signature.empty()) {
217 return GenerateKernelSignature(&kernel_collector); 220 return GenerateKernelSignature(&kernel_collector);
218 } 221 }
219 222
220 return HandleUserCrash(&user_collector); 223 return HandleUserCrash(&user_collector);
221 } 224 }
OLDNEW
« no previous file with comments | « no previous file | user_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698