neu*_*ron 12
这是我发现的简单方法:
define hook-stop
...commands to be executed when execution stops
end
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅此页:http://sourceware.org/gdb/current/onlinedocs/gdb/Hooks.html#Hooks
另一种“新”方法是使用Python 事件接口:
def stop_handler (event):
print "event type: stop"
gdb.events.stop.connect (stop_handler)
Run Code Online (Sandbox Code Playgroud)
这将触发stop_handler每个下级停止的功能。
还有另外两种类似的事件类型:
events.cont
events.exited
Run Code Online (Sandbox Code Playgroud)
分别在劣势延续或存在时触发。