public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Petr Ovtchenkov <ptr@void-ptr.info>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Cc: marc.glisse@inria.fr
Subject: Re: Alternative to __FILE__/__LINE__
Date: Sun, 04 Mar 2018 21:30:00 -0000	[thread overview]
Message-ID: <20180305003050.272a3923@void-ptr.info> (raw)
In-Reply-To: <alpine.DEB.2.21.1803042151140.21925@stedding.saclay.inria.fr>

On Sun, 4 Mar 2018 21:55:06 +0100 (CET)
Marc Glisse <marc.glisse@inria.fr> wrote:

> On Sun, 4 Mar 2018, François Dumont wrote:
> 
> >     Debug mode is using __FILE__/__LINE__ to show where the assertion took 
> > place. So assertion looks like this:
> >
> > /home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/debug/deque:175:
> > Error: function requires a valid iterator range [__first, __last).
> >
> >     But IMHO a smarter information would be to provide the file:line in the 
> > source code that generated this assertion so that users could more easily go 
> > to the faulty code.
> 
> How about printing a backtrace then? Though at some point the user might 
> want to start a debugger to get more information.
> 

Backtrace will require BFD. BFD may be unavailable or unwanted.

--

  - ptr

  reply	other threads:[~2018-03-04 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-04 20:18 François Dumont
2018-03-04 20:55 ` Marc Glisse
2018-03-04 21:30   ` Petr Ovtchenkov [this message]
2018-03-05  6:19     ` François Dumont
2018-03-18 17:04   ` François Dumont

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=20180305003050.272a3923@void-ptr.info \
    --to=ptr@void-ptr.info \
    --cc=libstdc++@gcc.gnu.org \
    --cc=marc.glisse@inria.fr \
    /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).