This is the mail archive of the gdb-prs@sources.redhat.com 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]

c++/1112: can't set breakpoint on destructor


>Number:         1112
>Category:       c++
>Synopsis:       can't set breakpoint on destructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 03 22:18:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     carlton at math dot stanford dot edu
>Release:        GNU gdb 2003-03-03-cvs
>Organization:
>Environment:
i686-pc-linux-gnu (Red Hat 7.3), GCC 3.1, DWARF 2
>Description:
GDB won't let me set a breakpoint on a destructor, unless
I add parentheses.

>How-To-Repeat:
Compile this:

class C {
public:
  ~C() {}
};

int main()
{
  C c;
}

Then:

jackfruit$ /extra/gdb/mirror/src/gdb/gdb a.out
GNU gdb 2003-03-03-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b C::~C
the class `C' does not have destructor defined
Hint: try 'C::~C<TAB> or 'C::~C<ESC-?>
(Note leading single quote.)
(gdb) b C::~C()
Breakpoint 1 at 0x8048515: file foo.cc, line 3.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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