Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 0/2] physname reg.: C++ breakpoints / linespec fixes
Date: Thu, 09 Jun 2011 13:47:00 -0000	[thread overview]
Message-ID: <20110609134715.GA13772@host1.jankratochvil.net> (raw)
In-Reply-To: <20110608144307.GA32073@host1.jankratochvil.net>

On Wed, 08 Jun 2011 16:43:07 +0200, Jan Kratochvil wrote:
> But for example `file:func' is currently implemented only in linespec and it
> should be supported even by expressions - see the bottom example.
[...]
> ==> a/f.c <==
> static void f (void) {}
> void x (void) { f (); }
> 
> ==> b/f.c <==
> static void f (void) {}
> void y (void) { f (); }
> 
> ==> m.c <==
> extern void x (void);
> extern void y (void);
> int
> main (void)
> {
>   x ();
>   y ();
>   return 0;
> }
> 
> gcc -o m a/f.c b/f.c m.c -Wall -g 
> (gdb) b a/f.c:f
> Breakpoint 1 at 0x400478: file a/f.c, line 1.
> (gdb) b b/f.c:f
> Breakpoint 2 at 0x40048c: file b/f.c, line 1.
> (gdb) b f
> Note: breakpoint 2 also set at pc 0x40048c.
> Breakpoint 3 at 0x40048c: file b/f.c, line 1.
> (gdb) p f
> $1 = {void (void)} 0x400488 <f>
> (gdb) p a/f.c:f
> No symbol "a" in current context.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = it should work.
> (gdb) p b/f.c:f
> No symbol "b" in current context.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = it should work.

I forgot it is doable in expressions, just with a different syntax than in
linespec:

(gdb) p 'a/f.c'::f
$1 = {void (void)} 0x400474 <f>
(gdb) p 'b/f.c'::f
$2 = {void (void)} 0x400488 <f>



Regards,
Jan


      reply	other threads:[~2011-06-09 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 20:26 Jan Kratochvil
2011-06-05 20:58 ` Jan Kratochvil
2011-06-07 20:24 ` Tom Tromey
2011-06-08 14:43   ` Jan Kratochvil
2011-06-09 13:47     ` Jan Kratochvil [this message]

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=20110609134715.GA13772@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --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