>gdb intarith > intarith.gdb GNU gdb Red Hat Linux (5.2-2) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) break main Breakpoint 1 at 0x8048370 (gdb) run Starting program: /afs/umbc.edu/users/s/q/squire/home/cs313/intarith Breakpoint 1, 0x08048370 in main () (gdb) set disassembly-flavor intel (gdb) disassemble main Dump of assembler code for function main: 0x8048370
: mov eax,0x5 0x8048375 : mov ds:0x8049624,eax 0x804837a : push ds:0x8049624 0x8048380 : push ds:0x80494e8 0x8048386 : push ds:0x80494e4 0x804838c : push 0x8049502 0x8048391 : push 0x80494ec 0x8048396 : call 0x8048298 0x804839b : add esp,0x14 End of assembler dump. (gdb) x/90xb main 0x8048370
: 0xb8 0x05 0x00 0x00 0x00 0xa3 0x24 0x96 0x8048378 : 0x04 0x08 0xff 0x35 0x24 0x96 0x04 0x08 0x8048380 :0xff 0x35 0xe8 0x94 0x04 0x08 0xff 0x35 0x8048388 :0xe4 0x94 0x04 0x08 0x68 0x02 0x95 0x04 0x8048390 :0x08 0x68 0xec 0x94 0x04 0x08 0xe8 0xfd 0x8048398 :0xfe 0xff 0xff 0x83 0xc4 0x14 0xa1 0xe4 0x80483a0 : 0x94 0x04 0x08 0x03 0x05 0xe8 0x94 0x04 0x80483a8 :0x08 0xa3 0x24 0x96 0x04 0x08 0xff 0x35 0x80483b0 :0x24 0x96 0x04 0x08 0xff 0x35 0xe8 0x94 0x80483b8 :0x04 0x08 0xff 0x35 0xe4 0x94 0x04 0x08 0x80483c0 :0x68 0x08 0x95 0x04 0x08 0x68 0xec 0x94 0x80483c8 :0x04 0x08 (gdb) info registers eax 0x1 1 ecx 0x42130f28 1108545320 edx 0xbffffc0c -1073742836 ebx 0x4213030c 1108542220 esp 0xbffffb9c 0xbffffb9c ebp 0xbffffbd8 0xbffffbd8 esi 0x40013020 1073819680 edi 0xbffffc04 -1073742844 eip 0x8048370 0x8048370 eflags 0x296 662 cs 0x23 35 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x0 0 gs 0x0 0 fctrl 0x37f 895 fstat 0x0 0 ftag 0xffff 65535 fiseg 0x0 0 fioff 0x0 0 foseg 0x0 0 fooff 0x0 0 fop 0x0 0 xmm0 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm1 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm2 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm3 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm4 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm5 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm6 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} xmm7 {f = {0x0, 0x0, 0x0, 0x0}} {f = {0, 0, 0, 0}} mxcsr 0x1f80 8064 orig_eax 0xffffffff -1 (gdb) print/x $esp $1 = 0xbffffb9c (gdb) print/x $eax $2 = 0x1 (gdb) nexti 0x08048375 in main () (gdb) print/x $esp $3 = 0xbffffb9c (gdb) print/x $eax $4 = 0x5 (gdb) next Single stepping until exit from function main, which has no line number information. 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6 (gdb) info float R7: Empty 0x00000000000000000000 R6: Empty 0x00000000000000000000 R5: Empty 0x00000000000000000000 R4: Empty 0x00000000000000000000 R3: Empty 0x00000000000000000000 R2: Empty 0x00000000000000000000 R1: Empty 0x00000000000000000000 =>R0: Empty 0x00000000000000000000 Status Word: 0x0000 TOP: 0 Control Word: 0x037f IM DM ZM OM UM PM PC: Extended Precision (64-bits) RC: Round to nearest Tag Word: 0xffff Instruction Pointer: 0x00:0x00000000 Operand Pointer: 0x00:0x00000000 Opcode: 0x0000 (gdb) info stack #0 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6 (gdb) q The program is running. Exit anyway? (y or n) y