Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gdb 当某个断点命中时终止程序_Gdb_Breakpoints - Fatal编程技术网

Gdb 当某个断点命中时终止程序

Gdb 当某个断点命中时终止程序,gdb,breakpoints,Gdb,Breakpoints,我正在使用gdb调试我的程序,我需要尝试多种输入组合。因此,为了让我更容易,有没有一种方法可以在某个断点命中时终止调试,这样我就可以用不同的输入再次运行它 如果某个断点命中,是否有方法终止调试 可以将命令附加到断点。你想要的是: break foo # creates breakpoint 1 commands 1 call _exit(1) # causes inferior process to exit. end

我正在使用gdb调试我的程序,我需要尝试多种输入组合。因此,为了让我更容易,有没有一种方法可以在某个断点命中时终止调试,这样我就可以用不同的输入再次运行它

如果某个断点命中,是否有方法终止调试

可以将命令附加到断点。你想要的是:

break foo        # creates breakpoint 1
commands 1
  call _exit(1)  # causes inferior process to exit. 
end