@@ -246,7 +246,8 @@ def __init__(
246
246
identifier ,
247
247
version ,
248
248
uuid ,
249
- path ):
249
+ path ,
250
+ verbose ):
250
251
symbolication .Image .__init__ (self , path , uuid )
251
252
self .add_section (
252
253
symbolication .Section (
@@ -255,6 +256,17 @@ def __init__(
255
256
"__TEXT" ))
256
257
self .identifier = identifier
257
258
self .version = version
259
+ self .verbose = verbose
260
+
261
+ def show_symbol_progress (self ):
262
+ """
263
+ Hide progress output and errors from system frameworks as they are plentiful.
264
+ """
265
+ if self .verbose :
266
+ return True
267
+ return not (self .path .startswith ("/System/Library/" ) or
268
+ self .path .startswith ("/usr/lib/" ))
269
+
258
270
259
271
def find_matching_slice (self ):
260
272
dwarfdump_cmd_output = subprocess .check_output (
@@ -271,8 +283,9 @@ def find_matching_slice(self):
271
283
return True
272
284
if not self .resolved_path :
273
285
self .unavailable = True
274
- print (("error\n error: unable to locate '%s' with UUID %s"
275
- % (self .path , self .get_normalized_uuid_string ())))
286
+ if self .show_symbol_progress ():
287
+ print (("error\n error: unable to locate '%s' with UUID %s"
288
+ % (self .path , self .get_normalized_uuid_string ())))
276
289
return False
277
290
278
291
def locate_module_and_debug_symbols (self ):
@@ -282,7 +295,8 @@ def locate_module_and_debug_symbols(self):
282
295
# Mark this as resolved so we don't keep trying
283
296
self .resolved = True
284
297
uuid_str = self .get_normalized_uuid_string ()
285
- print ('Getting symbols for %s %s...' % (uuid_str , self .path ), end = ' ' )
298
+ if self .show_symbol_progress ():
299
+ print ('Getting symbols for %s %s...' % (uuid_str , self .path ), end = ' ' )
286
300
if os .path .exists (self .dsymForUUIDBinary ):
287
301
dsym_for_uuid_command = '%s %s' % (
288
302
self .dsymForUUIDBinary , uuid_str )
@@ -332,7 +346,7 @@ def locate_module_and_debug_symbols(self):
332
346
self .unavailable = True
333
347
return False
334
348
335
- def __init__ (self , path ):
349
+ def __init__ (self , path , verbose ):
336
350
"""CrashLog constructor that take a path to a darwin crash log file"""
337
351
symbolication .Symbolicator .__init__ (self )
338
352
self .path = os .path .expanduser (path )
@@ -345,6 +359,7 @@ def __init__(self, path):
345
359
self .version = - 1
346
360
self .error = None
347
361
self .target = None
362
+ self .verbose = verbose
348
363
# With possible initial component of ~ or ~user replaced by that user's
349
364
# home directory.
350
365
try :
@@ -491,7 +506,8 @@ def __init__(self, path):
491
506
img_name .strip (),
492
507
img_version .strip ()
493
508
if img_version else "" ,
494
- uuid .UUID (img_uuid ), img_path )
509
+ uuid .UUID (img_uuid ), img_path ,
510
+ self .verbose )
495
511
self .images .append (image )
496
512
else :
497
513
print ("error: image regex failed for: %s" % line )
@@ -557,7 +573,9 @@ def create_target(self):
557
573
if self .target :
558
574
return self .target # success
559
575
print ('crashlog.create_target()...4' )
560
- print ('error: unable to locate any executables from the crash log' )
576
+ print ('error: Unable to locate any executables from the crash log.' )
577
+ print (' Try loading the executable into lldb before running crashlog' )
578
+ print (' and/or make sure the .dSYM bundles can be found by Spotlight.' )
561
579
return self .target
562
580
563
581
def get_target (self ):
@@ -683,7 +701,7 @@ def interactive_crashlogs(options, args):
683
701
crash_logs = list ()
684
702
for crash_log_file in crash_log_files :
685
703
# print 'crash_log_file = "%s"' % crash_log_file
686
- crash_log = CrashLog (crash_log_file )
704
+ crash_log = CrashLog (crash_log_file , options . verbose )
687
705
if crash_log .error :
688
706
print (crash_log .error )
689
707
continue
@@ -1022,7 +1040,7 @@ def SymbolicateCrashLogs(command_args):
1022
1040
interactive_crashlogs (options , args )
1023
1041
else :
1024
1042
for crash_log_file in args :
1025
- crash_log = CrashLog (crash_log_file )
1043
+ crash_log = CrashLog (crash_log_file , options . verbose )
1026
1044
SymbolicateCrashLog (crash_log , options )
1027
1045
if __name__ == '__main__' :
1028
1046
# Create a new debugger instance
0 commit comments