【发布时间】:2012-12-09 05:08:01
【问题描述】:
像这样捕获,使用 GDB:
catch throw
当抛出异常时,程序停止。
当异常被抛出但被程序捕获时,如何使 GDB 不停止? 或者我应该有全局 try-catch 而不是使用 GDB
catch throw
?
EDIT1
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
【问题讨论】:
-
您能否详细说明您的意思?或者至少发布一些完整的代码?
-
你没有使用 GDB catch throw
-
很难理解
catch throw部分是GDB命令。我建议你改写如“在 GDB 中使用命令catch throw时,...” -
抱歉误导。 EDIT2 为您服务