llvm.org GIT mirror llvm / afee151
llvm-objdump: Indent unwind info contents. Unwind info contents were indented at the same level as function table contents. That's a bit confusing because the unwind info is pointed by function table. In other places we usually increment indentation depth by one when dereferncing a pointer. This patch also removes extraneous newlines between function tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202879 91177308-0d34-0410-b5e6-96231b3b80d8 Rui Ueyama 5 years ago
2 changed file(s) with 91 addition(s) and 91 deletion(s). Raw diff Collapse all Expand all
88 OBJ-NEXT: Start Address: func
99 OBJ-NEXT: End Address: func + 0x001b
1010 OBJ-NEXT: Unwind Info Address: .xdata
11 OBJ-NEXT: Version: 1
12 OBJ-NEXT: Flags: 1 UNW_ExceptionHandler
13 OBJ-NEXT: Size of prolog: 18
14 OBJ-NEXT: Number of Codes: 8
15 OBJ-NEXT: Frame register: RBX
16 OBJ-NEXT: Frame offset: 0
17 OBJ-NEXT: Unwind Codes:
18 OBJ-NEXT: 0x12: UOP_SetFPReg
19 OBJ-NEXT: 0x0f: UOP_PushNonVol RBX
20 OBJ-NEXT: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
21 OBJ-NEXT: 0x09: UOP_SaveNonVol RSI [0x0010]
22 OBJ-NEXT: 0x04: UOP_AllocSmall 24
23 OBJ-NEXT: 0x00: UOP_PushMachFrame w/o error code
11 OBJ-NEXT: Version: 1
12 OBJ-NEXT: Flags: 1 UNW_ExceptionHandler
13 OBJ-NEXT: Size of prolog: 18
14 OBJ-NEXT: Number of Codes: 8
15 OBJ-NEXT: Frame register: RBX
16 OBJ-NEXT: Frame offset: 0
17 OBJ-NEXT: Unwind Codes:
18 OBJ-NEXT: 0x12: UOP_SetFPReg
19 OBJ-NEXT: 0x0f: UOP_PushNonVol RBX
20 OBJ-NEXT: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
21 OBJ-NEXT: 0x09: UOP_SaveNonVol RSI [0x0010]
22 OBJ-NEXT: 0x04: UOP_AllocSmall 24
23 OBJ-NEXT: 0x00: UOP_PushMachFrame w/o error code
2424 OBJ: Function Table:
2525 OBJ-NEXT: Start Address: func + 0x0012
2626 OBJ-NEXT: End Address: func + 0x0012
2727 OBJ-NEXT: Unwind Info Address: .xdata + 0x001c
28 OBJ-NEXT: Version: 1
29 OBJ-NEXT: Flags: 4 UNW_ChainInfo
30 OBJ-NEXT: Size of prolog: 0
31 OBJ-NEXT: Number of Codes: 0
32 OBJ-NEXT: No frame pointer used
28 OBJ-NEXT: Version: 1
29 OBJ-NEXT: Flags: 4 UNW_ChainInfo
30 OBJ-NEXT: Size of prolog: 0
31 OBJ-NEXT: Number of Codes: 0
32 OBJ-NEXT: No frame pointer used
3333 OBJ: Function Table:
3434 OBJ-NEXT: Start Address: smallFunc
3535 OBJ-NEXT: End Address: smallFunc + 0x0001
3636 OBJ-NEXT: Unwind Info Address: .xdata + 0x002c
37 OBJ-NEXT: Version: 1
38 OBJ-NEXT: Flags: 0
39 OBJ-NEXT: Size of prolog: 0
40 OBJ-NEXT: Number of Codes: 0
41 OBJ-NEXT: No frame pointer used
37 OBJ-NEXT: Version: 1
38 OBJ-NEXT: Flags: 0
39 OBJ-NEXT: Size of prolog: 0
40 OBJ-NEXT: Number of Codes: 0
41 OBJ-NEXT: No frame pointer used
4242 OBJ: Function Table:
4343 OBJ-NEXT: Start Address: allocFunc
4444 OBJ-NEXT: End Address: allocFunc + 0x001d
4545 OBJ-NEXT: Unwind Info Address: .xdata + 0x0034
46 OBJ-NEXT: Version: 1
47 OBJ-NEXT: Flags: 0
48 OBJ-NEXT: Size of prolog: 14
49 OBJ-NEXT: Number of Codes: 6
50 OBJ-NEXT: No frame pointer used
51 OBJ-NEXT: Unwind Codes:
52 OBJ-NEXT: 0x0e: UOP_AllocLarge 8454128
53 OBJ-NEXT: 0x07: UOP_AllocLarge 8190
54 OBJ-NEXT: 0x00: UOP_PushMachFrame w/o error code
46 OBJ-NEXT: Version: 1
47 OBJ-NEXT: Flags: 0
48 OBJ-NEXT: Size of prolog: 14
49 OBJ-NEXT: Number of Codes: 6
50 OBJ-NEXT: No frame pointer used
51 OBJ-NEXT: Unwind Codes:
52 OBJ-NEXT: 0x0e: UOP_AllocLarge 8454128
53 OBJ-NEXT: 0x07: UOP_AllocLarge 8190
54 OBJ-NEXT: 0x00: UOP_PushMachFrame w/o error code
5555
56 EXE: Function Table:
57 EXE: Start Address: 0x1000
58 EXE: End Address: 0x101b
59 EXE: Unwind Info Address: 0x2000
60 EXE: Version: 1
61 EXE: Flags: 1 UNW_ExceptionHandler
62 EXE: Size of prolog: 18
63 EXE: Number of Codes: 8
64 EXE: Frame register: RBX
65 EXE: Frame offset: 0
66 EXE: Unwind Codes:
67 EXE: 0x12: UOP_SetFPReg
68 EXE: 0x0f: UOP_PushNonVol RBX
69 EXE: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
70 EXE: 0x09: UOP_SaveNonVol RSI [0x0010]
71 EXE: 0x04: UOP_AllocSmall 24
72 EXE: 0x00: UOP_PushMachFrame w/o error code
56 EXE: Function Table:
57 EXE-NEXT: Start Address: 0x1000
58 EXE-NEXT: End Address: 0x101b
59 EXE-NEXT: Unwind Info Address: 0x2000
60 EXE-NEXT: Version: 1
61 EXE-NEXT: Flags: 1 UNW_ExceptionHandler
62 EXE-NEXT: Size of prolog: 18
63 EXE-NEXT: Number of Codes: 8
64 EXE-NEXT: Frame register: RBX
65 EXE-NEXT: Frame offset: 0
66 EXE-NEXT: Unwind Codes:
67 EXE-NEXT: 0x12: UOP_SetFPReg
68 EXE-NEXT: 0x0f: UOP_PushNonVol RBX
69 EXE-NEXT: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
70 EXE-NEXT: 0x09: UOP_SaveNonVol RSI [0x0010]
71 EXE-NEXT: 0x04: UOP_AllocSmall 24
72 EXE-NEXT: 0x00: UOP_PushMachFrame w/o error code
7373
74 EXE: Function Table:
75 EXE: Start Address: 0x1012
76 EXE: End Address: 0x1012
77 EXE: Unwind Info Address: 0x201c
78 EXE: Version: 1
79 EXE: Flags: 4 UNW_ChainInfo
80 EXE: Size of prolog: 0
81 EXE: Number of Codes: 0
82 EXE: No frame pointer used
74 EXE: Function Table:
75 EXE-NEXT: Start Address: 0x1012
76 EXE-NEXT: End Address: 0x1012
77 EXE-NEXT: Unwind Info Address: 0x201c
78 EXE-NEXT: Version: 1
79 EXE-NEXT: Flags: 4 UNW_ChainInfo
80 EXE-NEXT: Size of prolog: 0
81 EXE-NEXT: Number of Codes: 0
82 EXE-NEXT: No frame pointer used
8383
84 EXE: Function Table:
85 EXE: Start Address: 0x101b
86 EXE: End Address: 0x101c
87 EXE: Unwind Info Address: 0x202c
88 EXE: Version: 1
89 EXE: Flags: 0
90 EXE: Size of prolog: 0
91 EXE: Number of Codes: 0
92 EXE: No frame pointer used
84 EXE: Function Table:
85 EXE-NEXT: Start Address: 0x101b
86 EXE-NEXT: End Address: 0x101c
87 EXE-NEXT: Unwind Info Address: 0x202c
88 EXE-NEXT: Version: 1
89 EXE-NEXT: Flags: 0
90 EXE-NEXT: Size of prolog: 0
91 EXE-NEXT: Number of Codes: 0
92 EXE-NEXT: No frame pointer used
9393
94 EXE: Function Table:
95 EXE: Start Address: 0x101c
96 EXE: End Address: 0x1039
97 EXE: Unwind Info Address: 0x2034
98 EXE: Version: 1
99 EXE: Flags: 0
100 EXE: Size of prolog: 14
101 EXE: Number of Codes: 6
102 EXE: No frame pointer used
103 EXE: Unwind Codes:
104 EXE: 0x0e: UOP_AllocLarge 8454128
105 EXE: 0x07: UOP_AllocLarge 8190
106 EXE: 0x00: UOP_PushMachFrame w/o error code
94 EXE: Function Table:
95 EXE-NEXT: Start Address: 0x101c
96 EXE-NEXT: End Address: 0x1039
97 EXE-NEXT: Unwind Info Address: 0x2034
98 EXE-NEXT: Version: 1
99 EXE-NEXT: Flags: 0
100 EXE-NEXT: Size of prolog: 14
101 EXE-NEXT: Number of Codes: 6
102 EXE-NEXT: No frame pointer used
103 EXE-NEXT: Unwind Codes:
104 EXE-NEXT: 0x0e: UOP_AllocLarge 8454128
105 EXE-NEXT: 0x07: UOP_AllocLarge 8190
106 EXE-NEXT: 0x00: UOP_PushMachFrame w/o error code
9393 // slots is provided.
9494 static void printUnwindCode(ArrayRef UCs) {
9595 assert(UCs.size() >= getNumUsedSlots(UCs[0]));
96 outs() << format(" 0x%02x: ", unsigned(UCs[0].u.CodeOffset))
96 outs() << format(" 0x%02x: ", unsigned(UCs[0].u.CodeOffset))
9797 << getUnwindCodeTypeName(UCs[0].getUnwindOp());
9898 switch (UCs[0].getUnwindOp()) {
9999 case UOP_PushNonVol:
414414 // The casts to int are required in order to output the value as number.
415415 // Without the casts the value would be interpreted as char data (which
416416 // results in garbage output).
417 outs() << " Version: " << static_cast(UI->getVersion()) << "\n";
418 outs() << " Flags: " << static_cast(UI->getFlags());
417 outs() << " Version: " << static_cast(UI->getVersion()) << "\n";
418 outs() << " Flags: " << static_cast(UI->getFlags());
419419 if (UI->getFlags()) {
420420 if (UI->getFlags() & UNW_ExceptionHandler)
421421 outs() << " UNW_ExceptionHandler";
425425 outs() << " UNW_ChainInfo";
426426 }
427427 outs() << "\n";
428 outs() << " Size of prolog: " << static_cast(UI->PrologSize) << "\n";
429 outs() << " Number of Codes: " << static_cast(UI->NumCodes) << "\n";
428 outs() << " Size of prolog: " << static_cast(UI->PrologSize) << "\n";
429 outs() << " Number of Codes: " << static_cast(UI->NumCodes) << "\n";
430430 // Maybe this should move to output of UOP_SetFPReg?
431431 if (UI->getFrameRegister()) {
432 outs() << " Frame register: "
432 outs() << " Frame register: "
433433 << getUnwindRegisterName(UI->getFrameRegister()) << "\n";
434 outs() << " Frame offset: " << 16 * UI->getFrameOffset() << "\n";
434 outs() << " Frame offset: " << 16 * UI->getFrameOffset() << "\n";
435435 } else {
436 outs() << " No frame pointer used\n";
436 outs() << " No frame pointer used\n";
437437 }
438438 if (UI->getFlags() & (UNW_ExceptionHandler | UNW_TerminateHandler)) {
439439 // FIXME: Output exception handler data
442442 }
443443
444444 if (UI->NumCodes)
445 outs() << " Unwind Codes:\n";
445 outs() << " Unwind Codes:\n";
446446
447447 printAllUnwindCodes(ArrayRef(&UI->UnwindCodes[0], UI->NumCodes));
448448
449 outs() << "\n\n";
449 outs() << "\n";
450450 outs().flush();
451451 }
452452
459459 outs() << "Function Table:\n"
460460 << format(" Start Address: 0x%04x\n", RF.StartAddress)
461461 << format(" End Address: 0x%04x\n", RF.EndAddress)
462 << format(" Unwind Info Address: 0x%04x\n\n", RF.UnwindInfoOffset);
462 << format(" Unwind Info Address: 0x%04x\n", RF.UnwindInfoOffset);
463463 uintptr_t addr;
464464 if (Obj->getRvaPtr(RF.UnwindInfoOffset, addr))
465465 return;