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 exp/11927] New: looking up structure members as symtabs?


When parsing "p mybar.foo" gdb will do a global lookup of symbol "foo".
That seems a tad clumsy.

The bug, though, is that gdb may also try to lookup "foo" as a symtab.

play$ cat foo
/* Copy this to file "foo" and compile as
   gcc -g -x c foo -o foo.x
*/

struct bar
{
  int foo;
};

struct bar mybar;

int
main ()
{
  return 0;
}
play$ gcc -g -x c foo -o foo.x
play$ build/obj64/gdb/gdb foo.x
GNU gdb (GDB) 7.2.50.20100817-cvs
[...]
Reading symbols from /home/dje/src/play/foo.x...done.
(gdb) start
Temporary breakpoint 1 at 0x40044c: file foo, line 15.
Starting program: /home/dje/src/play/foo.x

Temporary breakpoint 1, main () at foo:15
15        return 0;
(gdb) p mybar.foo
A syntax error in expression, near `foo'.
(gdb)

-- 
           Summary: looking up structure members as symtabs?
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: exp
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: dje at google dot com
                CC: gdb-prs at sourceware dot org
  GCC host triplet: amd64-linux


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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