gdb - Prevent losing backtrace in a catch/rethrow situation

旧时模样 提交于 2019-12-05 09:23:59

needing a back trace from the original throw of the exception,

Is it OK to use a simple approach of printing all backtraces of all throws and then when it is necessary to find a backtrace of a particular exception just find it by the address of the exception. Something like this sequence of gdb commands:

set pagination off
catch throw
commands
info args
bt
c
end

When you need to find backtrace of an exception, first print its address, like this:

print &exception

And find its address in the gdb output. It must be printed by info args. As soon as you find address there will be backtrace of this exception after info args output.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!