Gdb 确定命中了哪个断点?

Gdb 确定命中了哪个断点?,gdb,Gdb,我正在尝试编写一个GDB脚本,该脚本“侦听”远程目标并响应两个进程之一的启动。我已经完成了目标定位部分,但仍然无法确定命中了哪个断点 脚本的外观如下所示: break *0x400de0 # Process 1 start addr break *0x40f650 # Process 2 start addr c # <- GDB waits here for one of the two processes to begin # hits o

我正在尝试编写一个GDB脚本,该脚本“侦听”远程目标并响应两个进程之一的启动。我已经完成了目标定位部分,但仍然无法确定命中了哪个断点

脚本的外观如下所示:

break *0x400de0    # Process 1 start addr
break *0x40f650    # Process 2 start addr
c                  # <- GDB waits here for one of the two processes to begin
# hits one of two breakpoints #
if (??? == "0x400de0")
    # do something
else
    # do something else
break*0x400de0#进程1启动地址
中断*0x40f650#进程2启动地址

我想你在寻找:

if ($pc == 0x400de0)
尝试变量。