From: Michael Elizabeth Chastain <mec@shout.net>
To: gdb@sources.redhat.com
Subject: (fyi) gcc 3.3.1, small change in 'operator int' method name
Date: Wed, 09 Jul 2003 15:16:00 -0000 [thread overview]
Message-ID: <200307091516.h69FGU20023830@duracef.shout.net> (raw)
I was looking at the differences between gcc 3.3 and gcc-3_3-branch
(soon to be gcc 3.3.1) and I found a small difference in conversion
operator encoding with -gstabs+. I think gdb already handles this
correctly but I just wanted to mention it.
Attached is a small example program with two conversion operators.
With gcc 3.3 -gstabs+ the conversion operators are encoded like this:
operator i::(1,10)=#(1,1),(0,1),(1,4),(1,7);:_ZN3FoocviEv;
operator d::(1,11)=#(1,1),(0,13),(1,4),(1,7);:_ZN3FoocvdEv;
With gcc gcc-3_3-branch%20030707 -gstabs+ (and also gcc HEAD%20030707)
the conversion operators are encoded like this:
operator 1::(1,10)=#(1,1),(0,1),(1,4),(1,7);:_ZN3FoocviEv;
operator 2::(1,11)=#(1,1),(0,13),(1,4),(1,7);:_ZN3FoocvdEv;
gdb 5.3 has a little glitch when it handles the new 'operator 1' method
name. is_type_conversion_operator does not recognize them as operator
names, so gdb prints their names as 'int operator int()', which is
wrong.
gdb gdb_6_0-branch and gdb HEAD have new code in the stabs reader,
update_method_name_from_physname. This code discards the method name
'operator 1' and replaces it with a a demangled version of
'ZN3FoocviEv'. So these versions of gdb don't even notice the change
from 'operator i' to 'operator 1'. The updated method name is always
'operator int' and is_type_conversion_operator always works correctly.
dbxout.c in gcc has not changed in the gcc 3.3 branch since the gcc 3.3
release. So this feels like an unintended change in gcc.
I just wanted to let y'all know about the method name change, just in
case it's ever important later. Also I wanted to check that I
understand update_method_name_from_physname properly.
Michael C
===
class Foo
{
public:
Foo (int);
operator int ();
operator double ();
private:
int member_;
};
Foo::Foo (int member)
: member_ (member)
{
;
}
Foo::operator int()
{
return member_;
}
Foo::operator double()
{
return 1.0 * member_;
}
int main ()
{
Foo my_foo (117);
return 0;
}
reply other threads:[~2003-07-09 15:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200307091516.h69FGU20023830@duracef.shout.net \
--to=mec@shout.net \
--cc=gdb@sources.redhat.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).