This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: catch-throw conditions?


Craig Miller wrote:
Does anyone know if there is a way to set a condition on breakpoints
created using the "catch throw" command?  Specifically to be able to
only cause a break when a specific C++ Exception is thrown?

In general, conditions work like this (not that the help command will tell you so):


catch throw if myerror == 42

I'm not sure where the exception flavour is kept though.

Hope that helps

Andrew


(Actually, on the GDB I have the conditions do not show on info break, and I don't have any C++ code handy to test, so it might be broken. If the condition doesn't work then try this:


   catch throw
   commands
     if myerror != 42
       continue
     end
   end
)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]