user8434768
user8434768

Reputation:

How to catch all exception types except one using GDB?

I'm aware of _catch throw_ or even _catch throw MyExceptionType_.

What I need is everything else than a certain exception type.

Upvotes: 2

Views: 405

Answers (2)

Gabriel Ravier
Gabriel Ravier

Reputation: 418

Since gdb uses a regular expression for the exception string, you could use catch throw (?!MyExceptionType) (this will match any exception except for exactly "MyExceptionType")

See also Match everything except for specified strings

Upvotes: 3

bruno
bruno

Reputation: 32586

Specify a condition for the breakpoint on catch throw, look at break condition

Upvotes: 1

Related Questions