public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: me22 <me22.ca@gmail.com>
To: "Yang Zhang" <yanghatespam@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Customizing uncaught exception messages
Date: Thu, 15 May 2008 09:48:00 -0000	[thread overview]
Message-ID: <fa28b9250805150015x70004027j47ea031336e702cb@mail.gmail.com> (raw)
In-Reply-To: <482BD231.4040401@gmail.com>

On Thu, May 15, 2008 at 2:03 AM, Yang Zhang <yanghatespam@gmail.com> wrote:
> Hi, is it possible to get more informative error messages for uncaught
> exceptions?  For instance, I'm interested in getting Java-like tracebacks
> with file and line numbers.  Currently what I see is far from that, e.g.:
>
> terminate called after throwing an instance of 'std::logic_error'
>  what():  basic_string::_S_construct NULL not valid
>
> Is there any way to hook into the exception handling mechanisms and produce
> such a traceback?  If the solution is platform-dependent, I am using
> GNU/Linux with gcc 4.2.3.
>

The information isn't stored anywhere, so by the time you get an
exception falling out of main and calling terminate, it's no longer
available.

Your debugger might let you automatically break on throws...

  reply	other threads:[~2008-05-15  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  7:16 Yang Zhang
2008-05-15  9:48 ` me22 [this message]
2008-05-15 15:40   ` Yang Zhang
2008-05-15 14:46 ` Joel Dice
2008-05-15 16:01   ` Yang Zhang
2008-05-15 16:05     ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa28b9250805150015x70004027j47ea031336e702cb@mail.gmail.com \
    --to=me22.ca@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=yanghatespam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).