Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Tom Tromey <tromey@redhat.com>,
	 gdb@sourceware.org,  Kai Tietz <ktietz70@googlemail.com>,
	 Chris Sutcliffe <ir0nh34d@gmail.com>
Subject: Re: [gdb-7.1] 10 days to branching...
Date: Fri, 12 Feb 2010 11:37:00 -0000	[thread overview]
Message-ID: <201002121137.05102.pedro@codesourcery.com> (raw)
In-Reply-To: <20100212061558.GA6205@adacore.com>

Thanks for taking care of this.

On Friday 12 February 2010 06:15:58, Joel Brobecker wrote:
> > |       sym_arr[i1] = lookup_symbol_in_language (phys_name,
> > |                                    NULL, FUNCTIONS_DOMAIN,
> > |                                    language,
> > |                                    (int *) NULL);
> > | -      if (sym_arr[i1])
> > | +      /* See PR10966.  Remove check on symbol domain and class when
> > | +         we stop using (bad) linkage names on constructors.  */
> > | +      if (sym_arr[i1] && (SYMBOL_DOMAIN (sym_arr[i1]) == VAR_DOMAIN
> > | +                          && SYMBOL_CLASS (sym_arr[i1]) == LOC_BLOCK))
> > |         i1++;
> 
> Tested with no regression on my end. Regarding my C++ compiler quality,
> I looked at gdb.sum, and I have 32 KFAILs and 20 FAILs in gdb.cp.
> However, upon further testing, it appears that the patches does not
> have the desired effect (or I applied it at the wrong location?):
> 
>     (gdb) b Foo::Foo
>     the class Foo does not have any method named Foo
>     Hint: try 'Foo::Foo<TAB> or 'Foo::Foo<ESC-?>
>     (Note leading single quote.)
>     Make breakpoint pending on future shared library load? (y or [n]) n
> 

This is what I'd expect.  In previous GDBs, if there's only one
contructor, like, say:

struct Foo
{
	Foo()
	{}
};

Foo foo;

int main (int argc, char **argv)
{
	return 0;
}

GDB would just do nothing in response to that command.

(gdb) b Foo::Foo
(gdb)

If you had multiple constructors, say:

struct Foo
{
	Foo()
	{}
	Foo(const char *foo)
	{}
};

Foo foo;
Foo bar("bar");

int main (int argc, char **argv)
{
	return 0;
}

GDB would create broken breakpoints for them at address 0...

(gdb) b Foo::Foo
[0] cancel
[1] all
?HERE
?HERE
>

"?HERE" was never supposed to be visible to the user, and should
have been replaced by the proper name for the
function (the constructors), but since GDB found the wrong symbol...

> 1
Breakpoint 2 at 0x0
Breakpoint 3 at 0x0
warning: Multiple breakpoints were set.
Use the "delete" command to delete unwanted breakpoints.
(gdb) info breakpoints
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   0x0000000000000000
3       breakpoint     keep y   0x0000000000000000

Not very useful either.

That happens is that the wrong symbols are found, and a
broken sal escapes to the breakpoints module.  Nowadays,
there's an assertion that catches this (without the
assertion, we'd crash instead).


Note that even with the workaround, this still works:

 (gdb) b 'Foo::Foo()'
 Breakpoint 2 at 0x8048455: file foo.cc, line 3.
 (gdb) b 'Foo::Foo(const char *)'
 Breakpoint 3 at 0x804845b: file foo.cc, line 5.

It's the Foo::Foo form that's been broken for ages:

 (gdb) p Foo::Foo
 Cannot look up value of a typedef


I just tried GDB 5.3 and 6.0, and they seem to get it
right though, so this was a regression at some point.  :-)

-- 
Pedro Alves


  reply	other threads:[~2010-02-12 11:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01  8:20 Joel Brobecker
2010-02-01 16:09 ` Chris Sutcliffe
2010-02-02  4:17   ` Joel Brobecker
2010-02-02 12:35     ` Chris Sutcliffe
2010-02-02 16:02       ` Kai Tietz
2010-02-02 16:27         ` Christopher Faylor
2010-02-02 16:46         ` Chris Sutcliffe
2010-02-02 18:46           ` Kai Tietz
2010-02-02 22:44         ` Christopher Faylor
2010-02-03  8:20           ` Kai Tietz
2010-02-03 19:39             ` Christopher Faylor
2010-02-05 22:02               ` Tom Tromey
2010-02-06  4:55                 ` Joel Brobecker
2010-02-06 16:26                 ` Pedro Alves
2010-02-06 18:41                   ` Matt Rice
2010-02-11 18:25                   ` Tom Tromey
     [not found]                     ` <20100212051007.GI2919@adacore.com>
2010-02-12  6:16                       ` Joel Brobecker
2010-02-12 11:37                         ` Pedro Alves [this message]
2010-02-12 11:47                       ` Pedro Alves
2010-02-12 17:13                         ` Tom Tromey
2010-02-12 19:01                           ` Pedro Alves
2010-02-12 20:11                             ` Michael Snyder
2010-02-03  8:15       ` André Pönitz
2010-02-03 12:01         ` Chris Sutcliffe
2010-02-12  1:24 ` Stan Shebs
2010-02-12  5:11   ` Joel Brobecker

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=201002121137.05102.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=ir0nh34d@gmail.com \
    --cc=ktietz70@googlemail.com \
    --cc=tromey@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