challenge2.2:break at 0x7c00

在初始化位置0x7c00设置实地址断点,测试断点正常。

同理,直接gdbinit修改断点为0x7c00即可;

$ cat tools/gdbinit

file bin/kernel
target remote :1234
break *0x7c00

执行make debug,看看断点是否正确,能否正常调试;

调试信息如下:

remote Thread 1 In:                                                                L??   PC: 0x7c00 
0x0000fff0 in ?? ()
Breakpoint 1 at 0x7c00
(gdb) c
Continuing.

Breakpoint 1, 0x00007c00 in ?? ()
(gdb) x/i $eip
=> 0x7c00: cli
(gdb)

可以看到断点和调试正常;