During these product generations chip capacity was

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: watching the program in action, while having considerable control over its execution. Figure 3.26 shows examples of some GDB commands that help when working with machine-level, IA32 programs. It is very helpful to first run OBJDUMP to get a disassembled version of the program. Our examples were based on running GDB on the file prog, described and disassembled on page 96. We would start GDB with the command line: unix> gdb prog 166 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS Command Starting and Stopping quit run kill Breakpoints break sum break *0x80483c3 delete 1 delete Execution stepi stepi 4 nexti continue finish Examining code disas disas sum disas 0x80483b7 disas 0x80483b7 0x80483c7 print /x $eip Examining data print $eax print /x $eax print /t $eax print 0x100 print /x 555 print /x ($ebp+8) print *(int *) 0xbffff890 print *(int *) ($ebp+8) x/2w 0xbffff890 x/20b sum Useful information info frame info registers help Effect Exit GDB Run your program (give command line arguments here) Stop your program Set breakpoint at entry to function sum Se...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online