This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/13590] always display addresses in "info var" output


http://sourceware.org/bugzilla/show_bug.cgi?id=13590

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppluzhnikov at google dot
                   |                            |com

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-01-11 20:51:39 UTC ---
I don't believe dje provided a sufficiently motivating example.

Consider:

foo.h
typedef struct foo { int x; } foo_t;

foo.c
#include "foo.h"

static foo_t foo;
...

bar.c
#include "foo.h"

static foo_t foo;
...

When the two files above are linked together, and "-g" is in effect, how can I
set a watchpoint on one or the other?

(gdb) info var foo
All variables matching regular expression "foo":

File foo.c:
static foo_t foo;

File bar.c:
static foo_t foo;

(gdb) p &foo
$2 = (foo_t *) 0x601028   <<< which one is this?

(gdb) p &foo.c::foo       <<< is there a syntax for that?
A syntax error in expression, near `::foo'.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]