Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Ian Lance Taylor <ian@wasabisystems.com>
Cc: Michael Elizabeth Chastain <mec.gnu@mindspring.com>,
	gdb@sources.redhat.com
Subject: Re: C++/Java regressions
Date: Wed, 26 Nov 2003 22:28:00 -0000	[thread overview]
Message-ID: <20031126222837.GA5007@nevyn.them.org> (raw)
In-Reply-To: <m37k1msrd4.fsf@gossamer.airs.com>

On Wed, Nov 26, 2003 at 05:21:43PM -0500, Ian Lance Taylor wrote:
> mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes:
> 
> > ian> Yes, I think it should print A::bar without the const.  I have the
> > ian> patch in my sources, but I haven't checked it in yet.
> > 
> > But what about:
> > 
> >   class Foo
> >   {
> >     public:
> >       int method ();
> >       int method () const;
> >   };
> > 
> > If the name comes back as "Foo::method" then we have ambiguity
> > in gdb's output.
> > 
> > I think the const looks ugly and the code that prints the function
> > name is also ugly.  But I don't wanna print the same name for two
> > different methods.
> 
> I have probably lost the context of the question.  I am only talking
> about the case where DMGL_PARAMS is not passed.  In that case, the
> demangler will indeed print `Foo::method' for both of your examples.
> For that matter, it will also print `Foo::method' for `int method
> (int);'.
> 
> If DMGL_PARAMS is passed, then the demangler will print
> `Foo::method()' and `Foo::method() const' as usual.
> 
> I think that is appropriate.  Without DMGL_PARAMS, you can't
> distinguish any Foo::method overloaded based on parameter types.  So
> it seems logical to me that you also shouldn't be able to distinguish
> overloading based on the method qualifier.  And that is how the V2
> demangler behaved when DMGL_PARAMS was not passed.
> 
> Does that make sense?

It does make sense, but I see Michael's concern.  If you look at the
complete GDB output in this case, you get roughly:
Stopped at breakpoint 1, A::bar ()		for A::bar()
Stopped at breakpoint 1, A::bar ()		for A::bar() const
Stopped at breakpoint 1, A::bar (a = 1)		for A::bar(int)

I still think the demangler should return A::bar.  If we want GDB's
output to be unambiguous then GDB is the right place to print the
const.  Without debug info we may not have it... but who really cares?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-11-26 22:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26 21:44 Michael Elizabeth Chastain
2003-11-26 22:21 ` Ian Lance Taylor
2003-11-26 22:28   ` Daniel Jacobowitz [this message]
2003-11-26 22:34     ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2003-11-26 22:48 Michael Elizabeth Chastain
2003-11-26 21:18 Michael Elizabeth Chastain
2003-11-26 21:33 ` Ian Lance Taylor
2003-11-25 17:06 Michael Elizabeth Chastain
2003-11-25 17:14 ` David Carlton
2003-11-25 17:59   ` Daniel Jacobowitz
2003-11-25 15:33 Michael Elizabeth Chastain
2003-11-25 14:49 Michael Elizabeth Chastain
2003-11-25 15:06 ` Daniel Jacobowitz
2003-11-25  4:44 Michael Elizabeth Chastain
2003-11-25 17:54 ` Ian Lance Taylor
2003-11-25  1:37 David Carlton
2003-11-25  3:58 ` Ian Lance Taylor
2003-11-26  4:04 ` Ian Lance Taylor
2003-11-26 15:32   ` Daniel Jacobowitz
2003-11-26 21:05     ` Ian Lance Taylor
2003-11-26 21:11       ` David Carlton
2003-11-26 21:12       ` Daniel Jacobowitz
2003-11-26 21:32         ` Ian Lance Taylor
2003-12-01 16:45           ` Daniel Jacobowitz
2003-11-30  2:57         ` Jim Blandy
2003-11-30  3:12           ` Daniel Jacobowitz

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=20031126222837.GA5007@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=ian@wasabisystems.com \
    --cc=mec.gnu@mindspring.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