set disassemble-next-line on
set dissasembly-flavor intel
b _start
run
while 1
info registers
stepi
end
quit
Run via: gdb -nx < ./gdbinit > ./out.txt
gdb complains at the end, but all is good and the info we want is in out.txt Don't do this for large binaries obviously ;)
gdb header removed
➝ head out.txt -n 70
[ .. ]
Breakpoint 1, _start () at inc.asm:8
/home/thlorenz/dev/asm/visulator/test/asm/inc.asm:8:170:beg:0x8048060
=> 0x08048060 <_start+0>: 90 nop
(gdb) (gdb) > > >eax 0x0 0
ecx 0x0 0
edx 0x0 0
ebx 0x0 0
esp 0xffffd350 0xffffd350
ebp 0x0 0x0
esi 0x0 0
edi 0x0 0
eip 0x8048060 0x8048060 <_start>
eflags 0x202 [ IF ]
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0 0
gs 0x0 0
/home/thlorenz/dev/asm/visulator/test/asm/inc.asm:11:190:beg:0x8048061
=> 0x08048061 <_start.start_test+0>: 40 inc eax
eax 0x0 0
ecx 0x0 0
edx 0x0 0
ebx 0x0 0
esp 0xffffd350 0xffffd350
ebp 0x0 0x0
esi 0x0 0
edi 0x0 0
eip 0x8048061 0x8048061 <_start.start_test>
eflags 0x202 [ IF ]
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0 0
gs 0x0 0
/home/thlorenz/dev/asm/visulator/test/asm/inc.asm:12:231:beg:0x8048062
=> 0x08048062 <_start.start_test+1>: 40 inc eax
eax 0x1 1
ecx 0x0 0
edx 0x0 0
ebx 0x0 0
esp 0xffffd350 0xffffd350
ebp 0x0 0x0
esi 0x0 0
edi 0x0 0
eip 0x8048062 0x8048062 <_start.start_test+1>
eflags 0x202 [ IF ]
cs 0x23 35
ss 0x2b 43
ds 0x2b 43