* catch-throw conditions? @ 2008-02-21 19:46 Craig Miller 2008-02-22 11:28 ` Andrew STUBBS 2008-02-22 14:20 ` Thiago Jung Bauermann 0 siblings, 2 replies; 8+ messages in thread From: Craig Miller @ 2008-02-21 19:46 UTC (permalink / raw) To: gdb 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? CentOS 4.5 gdb Red Hat Linux (6.3.0.0-1.143.el4rh) gcc 3.4.6 Thanks for any help you might be able to lend. I've hit a dead end with google and the GDB docs. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-21 19:46 catch-throw conditions? Craig Miller @ 2008-02-22 11:28 ` Andrew STUBBS 2008-02-22 14:20 ` Thiago Jung Bauermann 1 sibling, 0 replies; 8+ messages in thread From: Andrew STUBBS @ 2008-02-22 11:28 UTC (permalink / raw) To: Craig Miller; +Cc: gdb 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 ) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-21 19:46 catch-throw conditions? Craig Miller 2008-02-22 11:28 ` Andrew STUBBS @ 2008-02-22 14:20 ` Thiago Jung Bauermann 2008-02-22 14:25 ` Daniel Jacobowitz 1 sibling, 1 reply; 8+ messages in thread From: Thiago Jung Bauermann @ 2008-02-22 14:20 UTC (permalink / raw) To: Craig Miller; +Cc: gdb On Thu, 2008-02-21 at 11:24 -0800, 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? > > CentOS 4.5 > gdb Red Hat Linux (6.3.0.0-1.143.el4rh) > gcc 3.4.6 > > Thanks for any help you might be able to lend. I've hit a dead end > with google and the GDB docs. I have absolutely no experience with gdb's C++ support, but I saw with "help catch" that gdb 6.7.1 (the current GDB release) has this command: catch throw <exceptname> - a particular exception, when thrown Is it available in your GDB version (which is very old, BTW)? If not, I suggest obtaining the new GDB and trying it out. -- []'s Thiago Jung Bauermann Software Engineer IBM Linux Technology Center ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-22 14:20 ` Thiago Jung Bauermann @ 2008-02-22 14:25 ` Daniel Jacobowitz 2008-02-22 16:48 ` Daniel Jacobowitz 0 siblings, 1 reply; 8+ messages in thread From: Daniel Jacobowitz @ 2008-02-22 14:25 UTC (permalink / raw) To: Thiago Jung Bauermann; +Cc: Craig Miller, gdb On Fri, Feb 22, 2008 at 10:25:17AM -0300, Thiago Jung Bauermann wrote: > I have absolutely no experience with gdb's C++ support, but I saw with > "help catch" that gdb 6.7.1 (the current GDB release) has this command: > > catch throw <exceptname> - a particular exception, when thrown "help catch", unfortunately, is incorrect :-( IIRC this was implemented for HP aCC. The GNU support does not (yet) handle an exceptname. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-22 14:25 ` Daniel Jacobowitz @ 2008-02-22 16:48 ` Daniel Jacobowitz 2008-02-22 17:45 ` Doug Evans 0 siblings, 1 reply; 8+ messages in thread From: Daniel Jacobowitz @ 2008-02-22 16:48 UTC (permalink / raw) To: Thiago Jung Bauermann, Craig Miller, gdb On Fri, Feb 22, 2008 at 09:19:40AM -0500, Daniel Jacobowitz wrote: > "help catch", unfortunately, is incorrect :-( > > IIRC this was implemented for HP aCC. The GNU support does not (yet) > handle an exceptname. ... But if someone is interested, this would not be a huge project. Ada already supports something similar. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-22 16:48 ` Daniel Jacobowitz @ 2008-02-22 17:45 ` Doug Evans 2008-02-22 18:59 ` Daniel Jacobowitz 0 siblings, 1 reply; 8+ messages in thread From: Doug Evans @ 2008-02-22 17:45 UTC (permalink / raw) To: gdb; +Cc: Thiago Jung Bauermann, Craig Miller On Fri, Feb 22, 2008 at 6:24 AM, Daniel Jacobowitz <drow@false.org> wrote: > On Fri, Feb 22, 2008 at 09:19:40AM -0500, Daniel Jacobowitz wrote: > > "help catch", unfortunately, is incorrect :-( > > > > IIRC this was implemented for HP aCC. The GNU support does not (yet) > > handle an exceptname. > > ... But if someone is interested, this would not be a huge project. > Ada already supports something similar. Ok if I add something like the following to the ProjectIdeas page? [what are the rules for editing the wiki btw?] C++ * Implement catching of specific exceptions. Currently GDB does not support specifying a catchpoint for a particular exception. "catch catch" and "catch throw" work, but "catch catch exception_name" and "catch throw exception_name" do not. [or some such] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-22 17:45 ` Doug Evans @ 2008-02-22 18:59 ` Daniel Jacobowitz 2008-02-22 19:51 ` Adrian Jones 0 siblings, 1 reply; 8+ messages in thread From: Daniel Jacobowitz @ 2008-02-22 18:59 UTC (permalink / raw) To: Doug Evans; +Cc: gdb, Thiago Jung Bauermann, Craig Miller On Fri, Feb 22, 2008 at 09:36:50AM -0800, Doug Evans wrote: > On Fri, Feb 22, 2008 at 6:24 AM, Daniel Jacobowitz <drow@false.org> wrote: > > On Fri, Feb 22, 2008 at 09:19:40AM -0500, Daniel Jacobowitz wrote: > > > "help catch", unfortunately, is incorrect :-( > > > > > > IIRC this was implemented for HP aCC. The GNU support does not (yet) > > > handle an exceptname. > > > > ... But if someone is interested, this would not be a huge project. > > Ada already supports something similar. > > Ok if I add something like the following to the ProjectIdeas page? > [what are the rules for editing the wiki btw?] There aren't any. Far as I'm concerned you can add anything you want :-) Another useful thing would be to display the exception and to automatically show the frame with the throw/catch. I think Ada does those, too. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: catch-throw conditions? 2008-02-22 18:59 ` Daniel Jacobowitz @ 2008-02-22 19:51 ` Adrian Jones 0 siblings, 0 replies; 8+ messages in thread From: Adrian Jones @ 2008-02-22 19:51 UTC (permalink / raw) To: gdb On 22/02/2008, Daniel Jacobowitz <drow@false.org> wrote: > On Fri, Feb 22, 2008 at 09:36:50AM -0800, Doug Evans wrote: > > On Fri, Feb 22, 2008 at 6:24 AM, Daniel Jacobowitz <drow@false.org> wrote: > > > On Fri, Feb 22, 2008 at 09:19:40AM -0500, Daniel Jacobowitz wrote: > > > > "help catch", unfortunately, is incorrect :-( > > > > > > > > IIRC this was implemented for HP aCC. The GNU support does not (yet) > > > > handle an exceptname. > > > > > > ... But if someone is interested, this would not be a huge project. > > > Ada already supports something similar. > > > > Ok if I add something like the following to the ProjectIdeas page? > > [what are the rules for editing the wiki btw?] > > > There aren't any. Far as I'm concerned you can add anything you want > :-) > > Another useful thing would be to display the exception and to > automatically show the frame with the throw/catch. I think Ada does > those, too. I suppose just adding a breakpoint in the exception constructor is a little hacky for what you are after here -Adrian ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-22 18:59 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-02-21 19:46 catch-throw conditions? Craig Miller 2008-02-22 11:28 ` Andrew STUBBS 2008-02-22 14:20 ` Thiago Jung Bauermann 2008-02-22 14:25 ` Daniel Jacobowitz 2008-02-22 16:48 ` Daniel Jacobowitz 2008-02-22 17:45 ` Doug Evans 2008-02-22 18:59 ` Daniel Jacobowitz 2008-02-22 19:51 ` Adrian Jones
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox