According to the documentation I can break on specific exception type by using conditional breakpoints. However the syntax for the condition isn\'t very clear to me:
Another approach is to rely on the tinfo
argument available when the catch point is triggered, which is a pointer to the object returned by typeid(type)
.
So say if I want to catch exception std::bad_alloc
being thrown, I could just do:
> p &typeid(std::bad_alloc)
> $1 = (__cxxabiv1::__si_class_type_info *) 0x8c6db60
> catch throw if tinfo == 0x8c6db60