Information we extract from objdump
Objdump has a variety of options, which allow it to output many different properties of its input files. This blueprint describes which options are used in Sextant, and to what effect.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Patrick Stevens
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Currently, we use objdump -D (for 'disassemble all sections'), although we subsequently throw away all but the .text section.
Suggestions for flags to use: --line-numbers (-l) to attach information as to which line of code in which file each chunk of disassembly came from. Sample:
080485d4 <ex1_alloc_word>:
ex1_alloc_word():
/home/patrickas
80485d4: 55 push %ebp
80485d5: 89 e5 mov %esp,%ebp
80485d7: 83 ec 28 sub $0x28,%esp
/home/patrickas
80485da: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80485e1: 00
80485e2: c7 04 24 54 00 00 00 movl $0x54,(%esp)
80485e9: e8 22 ff ff ff call 8048510 <calloc@plt>
80485ee: 89 45 f4 mov %eax,-0xc(%ebp)
/home/patrickas
80485f1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80485f5: 74 26 je 804861d <ex1_alloc_
/home/patrickas
80485f7: b8 20 8a 04 08 mov $0x8048a20,%eax
80485fc: 8b 55 f4 mov -0xc(%ebp),%edx
80485ff: 8d 4a 04 lea 0x4(%edx),%ecx
--source (-s) to intersperse the disassembly with lines of source code (less useful, I imagine).