像这样捕捉,使用 GDB:
catch throw
抛出异常时,程序停止。
抛出异常但被程序捕获时如何使GDB不停止?或者我应该有全局try-catch而不使用GDB
catch throw
?
编辑1
try
{
// every time exception is thrown
// program is stopped by GDB
}
catch(const std::exception &e)
{
// even if the exception is caught by the program
}
EDIT2启动 gdb
gdb
file /usr/home/user/program
shell ps x
attach #pid
catch throw
c