Bug 9598

Summary: help catch is outdated regarding C++ exceptions
Product: gdb Reporter: Phil Muldoon <pmuldoon>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: gdb-prs, mark, tromey
Priority: P3    
Version: 6.8   
Target Milestone: 7.5   
Host: Target:
Build: Last reconfirmed:

Description Phil Muldoon 2008-08-05 15:08:02 UTC
[Converted from Gnats 2493]

help catch details regarding exceptions:

Raised exceptions may be caught:
	catch throw               - all exceptions, when thrown
	catch throw <exceptname>  - a particular exception, when thrown
	catch catch               - all exceptions, when caught
	catch catch <exceptname>  - a particular exception, when caught


and

C++ exceptions may be caught:
	catch throw               - all exceptions, when thrown
	catch catch               - all exceptions, when caught


These are essentially the same.

catch throw <<exception>> and catch catch <<exception>> do not work, and have no support.

catch catch and catch throw both place breakpoints in the C++ throw code (__cxa_throw) and catch (__cxa_begin_catch) code so are in fact C++ specific.  As far as I can tell it has always been this way in these specific handlers

Release:
6.8
Comment 1 Phil Muldoon 2008-08-05 15:08:02 UTC
Fix:
The generic section of catch catch/throw needs to be deleted while preserving the C++ specific text.
Comment 2 Mark Wielaard 2011-02-02 16:21:35 UTC
Or instead of removing the help text about being able to handle only named catch/throws, implement the <exceptionname> feature. It actually looks useful. I was a little sad it didn't work after reading the help text.
Comment 3 Sourceware Commits 2012-01-11 18:30:32 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2012-01-11 18:30:20

Modified files:
	gdb            : ChangeLog breakpoint.c 

Log message:
	PR gdb/9598:
	* breakpoint.c (_initialize_breakpoint): Fix help for "catch
	catch" and "catch throw".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13730&r2=1.13731
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?cvsroot=src&r1=1.639&r2=1.640
Comment 4 Tom Tromey 2012-01-11 18:36:19 UTC
(In reply to comment #2)
> Or instead of removing the help text about being able to handle only named
> catch/throws, implement the <exceptionname> feature. It actually looks useful.
> I was a little sad it didn't work after reading the help text.

I filed PR 13588 for this.

Meanwhile, the documentation bug is fixed.