This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/23888] should debug mode throw instead of assert?
- From: "sylvain dot pion at sophia dot inria dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2008 14:42:54 -0000
- Subject: [Bug libstdc++/23888] should debug mode throw instead of assert?
- References: <bug-23888-365@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from sylvain dot pion at sophia dot inria dot fr 2008-08-12 14:42 -------
What about providing both modes, with for example a global run-time flag to
select the mode which is the most appropriate ? And maybe defaulting to
assert, since it looks like users might prefer this (?).
Also, a side note : throwing an uncaught exception does not seem to destroy the
stack, when you are under the debugger. I just made a test, and it seems to
work. Here is the typical backtrace that you get:
(gdb) bt
#0 0x94ed0b9e in __kill ()
#1 0x94ed0b91 in kill$UNIX2003 ()
#2 0x94f47ec2 in raise ()
#3 0x94f5747f in abort ()
#4 0x91261005 in __gnu_cxx::__verbose_terminate_handler ()
#5 0x9125f10c in __gxx_personality_v0 ()
#6 0x9125f14b in std::terminate ()
#7 0x9125f261 in __cxa_throw ()
#8 0x00001f79 in f (i=1) at test_throw_debug.cpp:3
#9 0x00001f8c in main () at test_throw_debug.cpp:9
I agree it is still a problem for programs that catch the exception, thinking
no other exception should occur.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23888