Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(43)

Unified Diff: src/tools/mac/crash_report/crash_report.mm

Issue 31001: Added ability for crash_report to run through a directory Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: adding nealsid's suggestions Created 15 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tools/mac/crash_report/crash_report.mm
===================================================================
--- src/tools/mac/crash_report/crash_report.mm (revision 404)
+++ src/tools/mac/crash_report/crash_report.mm (working copy)
@@ -222,10 +222,8 @@
}
}
-//=============================================================================
-static void Start(Options *options) {
- string minidump_file([options->minidumpPath fileSystemRepresentation]);
-
+static void ProcessSingleReport(Options *options, NSString *file_path) {
+ string minidump_file([file_path fileSystemRepresentation]);
BasicSourceLineResolver resolver;
string search_dir = options->searchDir ?
[options->searchDir fileSystemRepresentation] : "";
@@ -304,12 +302,37 @@
printf("\nThread %d:", requesting_thread);
PrintRegisters(process_state.threads()->at(requesting_thread), cpu);
}
-
+
// Print information about modules
PrintModules(process_state.modules());
}
//=============================================================================
+static void Start(Options *options) {
+ NSFileManager *manager = [NSFileManager defaultManager];
+ NSString *minidump_path = options->minidumpPath;
+ BOOL is_dir = NO;
+ BOOL file_exists = [manager fileExistsAtPath:minidump_path
+ isDirectory:&is_dir];
+ if (file_exists && is_dir) {
+ NSDirectoryEnumerator *enumerator =
+ [manager enumeratorAtPath:minidump_path];
+ NSString *current_file = nil;
+ while ((current_file = [enumerator nextObject])) {
+ if ([[current_file pathExtension] isEqualTo:@"dmp"]) {
+ printf("Attempting to process report: %s\n",
+ [current_file cStringUsingEncoding:NSASCIIStringEncoding]);
+ NSString *full_path =
+ [minidump_path stringByAppendingPathComponent:current_file];
+ ProcessSingleReport(options, full_path);
+ }
+ }
+ } else if (file_exists) {
+ ProcessSingleReport(options, minidump_path);
+ }
+}
+
+//=============================================================================
static void Usage(int argc, const char *argv[]) {
fprintf(stderr, "Convert a minidump to a crash report. Breakpad symbol "
"files will be used (or created if missing) in /tmp.\n"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted