File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
test/Shell/ScriptInterpreter/Python/Crashlog Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -418,11 +418,15 @@ def parse(self):
418
418
self .parse_images (self .data ['usedImages' ])
419
419
self .parse_threads (self .data ['threads' ])
420
420
thread = self .crashlog .threads [self .crashlog .crashed_thread_idx ]
421
- thread .reason = self .parse_crash_reason (self .data ['exception' ])
421
+ reason = self .parse_crash_reason (self .data ['exception' ])
422
+ if thread .reason :
423
+ thread .reason = '{} {}' .format (thread .reason , reason )
424
+ else :
425
+ thread .reason = reason
422
426
except (KeyError , ValueError , TypeError ) as e :
423
- raise CrashLogParseException (
424
- 'Failed to parse JSON crashlog: {}: {}' .format (
425
- type (e ).__name__ , e ))
427
+ raise CrashLogParseException (
428
+ 'Failed to parse JSON crashlog: {}: {}' .format (
429
+ type (e ).__name__ , e ))
426
430
427
431
return self .crashlog
428
432
@@ -480,6 +484,8 @@ def parse_threads(self, json_threads):
480
484
idx = 0
481
485
for json_thread in json_threads :
482
486
thread = self .crashlog .Thread (idx , False )
487
+ if 'name' in json_thread :
488
+ thread .reason = json_thread ['name' ]
483
489
if json_thread .get ('triggered' , False ):
484
490
self .crashlog .crashed_thread_idx = idx
485
491
self .registers = self .parse_thread_registers (
Original file line number Diff line number Diff line change 40
40
{
41
41
"triggered": true,
42
42
"id": 6152004,
43
+ "name": "Crashing Thread Name",
43
44
"threadState": {
44
45
"r13": {
45
46
"value": 0
Original file line number Diff line number Diff line change 3
3
# RUN: python %S/patch-crashlog.py --binary %t.out --crashlog %t.crash --offsets '{"main":20, "bar":9, "foo":16}' --json
4
4
# RUN: %lldb %t.out -o 'command script import lldb.macosx.crashlog' -o 'crashlog %t.crash' 2>&1 | FileCheck %s
5
5
6
- # CHECK: Thread[0] EXC_BAD_ACCESS (SIGSEGV) (KERN_INVALID_ADDRESS at 0x0000000000000000)
6
+ # CHECK: Thread[0] Crashing Thread Name EXC_BAD_ACCESS (SIGSEGV) (KERN_INVALID_ADDRESS at 0x0000000000000000)
7
7
# CHECK: [ 0] {{.*}}out`foo + 16 at test.c
8
8
# CHECK: [ 1] {{.*}}out`bar + 8 at test.c
9
9
# CHECK: [ 2] {{.*}}out`main + 19 at test.c
You can’t perform that action at this time.
0 commit comments