From: Daniel Berlin <dberlin@dberlin.org>
To: Ian Lance Taylor <ian@airs.com>
Cc: Gunther Piez <gpiez@web.de>, gcc-help@gcc.gnu.org
Subject: Re: Is is possible to use the name of a variable in the constructor?
Date: Mon, 01 Aug 2005 04:13:00 -0000 [thread overview]
Message-ID: <1122869578.32467.102.camel@linux.site> (raw)
In-Reply-To: <m3ll3m1i6j.fsf@gossamer.airs.com>
On Sun, 2005-07-31 at 19:53 -0700, Ian Lance Taylor wrote:
> Gunther Piez <gpiez@web.de> writes:
>
> > Am Montag, 1. August 2005 02:04 schrieb Ian Lance Taylor:
> > > Gunther Piez <gpiez@web.de> writes:
> > > > struct uniform {
> > > > uniform() {
> > > > cout << "A variable called " << __PRETTY_VARNAME__ << " was just
> > > > instantinated (sp)" << endl;
> > > > }
> > > > };
>
> ...
>
> > Maybe it is possible to use the debugging information somehow? At least the
> > debugger usually knows the names of variables.
>
> Maybe it is possible, but nothing straightforward comes to mind.
You still have the issue that you need to have all the *actual* callers
in front of you, so you'd have to process debug info on the fly if you
were dlopen'ing stuff like plugins.
> Remember that the debugger doesn't know the name within
> uniform::uniform. It only knows the name if you go up the stack frame
> to the caller.
>
> Ian
next prev parent reply other threads:[~2005-08-01 4:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-31 23:56 Gunther Piez
2005-08-01 0:04 ` Ian Lance Taylor
2005-08-01 0:32 ` Gunther Piez
2005-08-01 2:54 ` Ian Lance Taylor
2005-08-01 4:13 ` Daniel Berlin [this message]
2005-08-01 20:04 ` Gunther Piez
2005-08-01 11:29 ` Eljay Love-Jensen
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=1122869578.32467.102.camel@linux.site \
--to=dberlin@dberlin.org \
--cc=gcc-help@gcc.gnu.org \
--cc=gpiez@web.de \
--cc=ian@airs.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).