@@ -351,6 +351,12 @@ def dump(self):
351
351
for image in self .images :
352
352
image .dump (' ' )
353
353
354
+ def set_main_image (self , identifier ):
355
+ for i , image in enumerate (self .images ):
356
+ if image .identifier == identifier :
357
+ self .images .insert (0 , self .images .pop (i ))
358
+ break
359
+
354
360
def find_image_with_identifier (self , identifier ):
355
361
for image in self .images :
356
362
if image .identifier == identifier :
@@ -435,6 +441,7 @@ def parse(self):
435
441
try :
436
442
self .parse_process_info (self .data )
437
443
self .parse_images (self .data ['usedImages' ])
444
+ self .parse_main_image (self .data )
438
445
self .parse_threads (self .data ['threads' ])
439
446
self .parse_errors (self .data )
440
447
thread = self .crashlog .threads [self .crashlog .crashed_thread_idx ]
@@ -485,6 +492,11 @@ def parse_images(self, json_images):
485
492
self .crashlog .images .append (darwin_image )
486
493
idx += 1
487
494
495
+ def parse_main_image (self , json_data ):
496
+ if 'procName' in json_data :
497
+ proc_name = json_data ['procName' ]
498
+ self .crashlog .set_main_image (proc_name )
499
+
488
500
def parse_frames (self , thread , json_frames ):
489
501
idx = 0
490
502
for json_frame in json_frames :
0 commit comments