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++/1665: catching exceptions could be more userfriendly


>Number:         1665
>Category:       c++
>Synopsis:       catching exceptions could be more userfriendly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 09 13:18:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     maekd@mai.liu.se
>Release:        GNU gdb 6.1-debian
>Organization:
>Environment:
Linux 2.4.21 i686
debian unstable
>Description:
It would be nice if one could give gdb the command to break at exceptions before the program starts. Otherwise one has to issue another breakpoint just to add a breakpoint. I.e:

(gdb) catch throw
Function "__cxa_throw" not defined.
(gdb) break 4
Breakpoint 1 at 0x8048795: file test.cc, line 4.
(gdb) run
Starting program: /tmp/a.out 

Breakpoint 1, main () at test.cc:4
4           std::cout << "Hello World\n";
(gdb) catch throw
Catchpoint 2 (throw)
--
Additionally it was not clear why catch throw did'nt default to a break at __raise_exception, in the case of gnu C++.
>How-To-Repeat:
compile
--
#include<iostream>
int main() {
  try {
    std::cout << "Hello World\n";
  }
  catch (std::exception& e) {
    std::cout << e.what() << "\n";
  }
}
--
and follow Description.
>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]