1 assume the following values are stored at the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: viated ‘x’) bytes (abbreviated ‘b’). You will find that GDB has many useful features for analyzing machine-level programs, as will be discussed in Section 3.12. End Aside. To inspect the contents of object code files, a class of programs known as disassemblers can be invaluable. These programs generate a format similar to assembly code from the object code. With Linux systems, the program OBJDUMP (for “object dump”) can serve this role given the ‘-d’ command line flag: unix> objdump -d code.o The result is (where we have added line numbers on the left and annotations on the right): Disassembly of function sum in file code.o 1 2 3 4 5 6 7 8 9 10 00000000 <sum>: Offset Bytes Equivalent assembly language 0: 1: 3: 6: 9: f: 11: 12: 13: 55 89 8b 03 01 89 5d c3 90 e5 45 0c 45 08 05 00 00 00 00 ec push mov mov add add mov pop ret nop %ebp %esp,%ebp 0xc(%ebp),%eax 0x8(%ebp),%eax %eax,0x0 %ebp,%esp %ebp On the left we see the 19 hexadecimal byte values listed in the byte s...
View Full Document

Ask a homework question - tutors are online