summaryrefslogtreecommitdiffstats
path: root/chrome/tools/process_dumps_linux.py
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 23:25:51 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 23:25:51 +0000
commitfd4b62df1b8eb5d3a6e2143ed86db144a1c29af2 (patch)
treeb2b626db41fa487346ae49bc2679825915100026 /chrome/tools/process_dumps_linux.py
parent1bb866e3187c423f730f3223c06fc4b1b65225c7 (diff)
downloadchromium_src-fd4b62df1b8eb5d3a6e2143ed86db144a1c29af2.zip
chromium_src-fd4b62df1b8eb5d3a6e2143ed86db144a1c29af2.tar.gz
chromium_src-fd4b62df1b8eb5d3a6e2143ed86db144a1c29af2.tar.bz2
Add a dump-file option to process_dumps_linux.py
TEST=run process_dumps_linux.py with --dump-file option. BUG=22265 Review URL: http://codereview.chromium.org/342030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/process_dumps_linux.py')
-rwxr-xr-xchrome/tools/process_dumps_linux.py34
1 files changed, 22 insertions, 12 deletions
diff --git a/chrome/tools/process_dumps_linux.py b/chrome/tools/process_dumps_linux.py
index 6e35640..299c9e7 100755
--- a/chrome/tools/process_dumps_linux.py
+++ b/chrome/tools/process_dumps_linux.py
@@ -222,12 +222,22 @@ def main_linux(options, args):
return 1
symbol_time = os.path.getmtime(symbol_file)
- dump_dir = options.dump_dir
- if not dump_dir:
- dump_dir = GetCrashDumpDir()
- if not dump_dir:
- print 'Cannot find dump dir.'
- return 1
+ dump_files = []
+ if options.dump_file:
+ dump_files.append(options.dump_file)
+ else:
+ dump_dir = options.dump_dir
+ if not dump_dir:
+ dump_dir = GetCrashDumpDir()
+ if not dump_dir:
+ print 'Cannot find dump files.'
+ return 1
+ for dump_file in LocateFiles(pattern='*.dmp', root=dump_dir):
+ file_time = os.path.getmtime(dump_file)
+ if file_time < symbol_time:
+ # Ignore dumps older than symbol file.
+ continue
+ dump_files.append(dump_file)
temp_dir = tempfile.mkdtemp(suffix='chromedump')
if not VerifySymbolAndCopyToTempDir(symbol_file, temp_dir):
@@ -236,11 +246,7 @@ def main_linux(options, args):
return 1
dump_count = 0
- for dump_file in LocateFiles(pattern='*.dmp', root=dump_dir):
- file_time = os.path.getmtime(dump_file)
- if file_time < symbol_time:
- # Ignore dumps older than symbol file.
- continue
+ for dump_file in dump_files:
processed_dump_file = ProcessDump(dump_file, temp_dir)
if not processed_dump_file:
continue
@@ -261,9 +267,13 @@ if '__main__' == __name__:
help='The directory where the processor is installed. '
'The processor is used to get stack trace from dumps. '
'Searches $PATH by default')
+ parser.add_option('', '--dump-file', type='string', default='',
+ help='The path of the dump file to be processed. '
+ 'Overwrites dump-path.')
parser.add_option('', '--dump-dir', type='string', default='',
help='The directory where dump files are stored. '
- 'Searches the Chromium crash directory by default.')
+ 'Searches this directory if dump-file is not '
+ 'specified. Default is the Chromium crash directory.')
parser.add_option('', '--symbol-dir', default='',
help='The directory with the symbols file. [Required]')
parser.add_option('', '--architecture', type='int', default=None,