这是我的makefile代码
all: ass3
ass3: ass3.asm
nasm -f elf ass3.asm
ld -m elf_i386 -s ass3.o -o demo
echo Start debugging\n
gdb demo
echo Breakpoint after first case has been calculated\n
b *0x804809e
echo Printing 1st case answer\n
i ecx
echo Breakpoint after second case has been calculated\n
b *0x80480ba
i ecx
echo Breakpoint on third case showing the execution path when the difference of time is negative\n
b *0x8048113
echo Since Initial time is large than final time, it will jump to an error catcher\n
r
echo Program caught the error and terminated the program\n
binaries = demo
clean:
rm -f $(binaries) *~
当我键入make时,它在gdb上停止,当我按下“q”(退出)时,它只是继续执行回显,直到它停止在b * 0x804809e这是一个gdb命令
如何让我的makefile代码在gdb上运行演示?
答案 0 :(得分:2)
gdb启动自己的提示,因此您无法直接与其进行交互。
它在启动后在启动时读取.gdbinit
,因此您可以修改它以使其自动化。
修改:
这些问题可能会对您有所帮助: