Oracle Solaris Studio 12.2:使用 dbx 调试程序

intercept 命令

intercept 命令用于抛出指定类型的 (C++) 异常(仅限于 C++)。仅在本地模式中有效。

当所抛出异常的类型与拦截列表中的某一类型匹配时,dbx 将停止,除非该异常的类型也与排除列表中的某一类型匹配。没有匹配捕获的抛出异常称为“未处理”抛出。与从中抛出异常的函数的异常规范不匹配的抛出异常称为“意外”抛出。

缺省情况下,会拦截未处理的抛出和意外抛出。

语法

intercept -x excluded_typename [, excluded_typename ...]

excluded_typename 的抛出添加到排除列表。

intercept -a[ll] -x excluded_typename [, excluded_typename...]

excluded_typename 之外的所有类型添加到拦截列表。

intercept -s[et] [intercepted_typename [, intercepted_typename ...]] [-x excluded_typename [, excluded_typename]]

清除拦截列表和排除列表,并设置列表以仅拦截或排除指定类型的抛出。

intercept

列出被拦截的类型。

其中:

included_typenameexcluded_typename 是异常类型规范,如 List <int>unsigned short