1
使用gdb调试不熟悉的程序时,程序通常会在执行next
后意外退出。当发生这种情况时,我通常会设置一个中断点,重新运行程序并执行step
而不是next
来跟踪发生的事情。但是,有时很难知道在哪里设置中断点。有没有一种技术会自动设置中断?喜欢的东西:gdb挂钩设置中断
define hook-next
break
end
define hookpost-next
# delete the previous break if the program is still running
end