This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/632: g++ compiled struct structname structname; => can't eval structname.
- From: rbrown64 at csc dot com dot au
- To: gdb-gnats at sources dot redhat dot com
- Date: 6 Aug 2002 09:15:41 -0000
- Subject: gdb/632: g++ compiled struct structname structname; => can't eval structname.
- Reply-to: rbrown64 at csc dot com dot au
>Number: 632
>Category: gdb
>Synopsis: g++ compiled struct structname structname; => can't eval structname.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 06 02:18:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: rbrown64@csc.com.au
>Release: gdb-5.2
>Organization:
>Environment:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
>Description:
501 ~ % cat tmp.c
#include <stdio.h>
struct a {
int b;
};
struct a a;
int main(int argc, char **argv)
{
a.b = argc;
printf("%d %s\n", a.b, argv[0]);
exit(0);
}
502 ~ % gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
503 ~ % gcc -g -o tmp.bin tmp.c
504 ~ % src/gdb-5.2.obj/gdb/gdb tmp.bin
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
...
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b 12
Breakpoint 1 at 0x804841e: file tmp.c, line 12.
(gdb) r
Starting program: /var/home/rdb/tmp.bin
Breakpoint 1, main (argc=1, argv=0xbffff174) at tmp.c:12
12 printf("%d %s\n", a.b, argv[0]);
(gdb) p a
$1 = {b = 1}
(gdb) c
Continuing.
1 /var/home/rdb/tmp.bin
Program exited normally.
(gdb) q
505 ~ % g++ -g -o tmp.bin tmp.c
506 ~ % src/gdb-5.2.obj/gdb/gdb tmp.bin
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
...
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b 12
Breakpoint 1 at 0x804853e: file tmp.c, line 12.
(gdb) r
Starting program: /var/home/rdb/tmp.bin
Breakpoint 1, main (argc=1, argv=0xbffff174) at tmp.c:12
12 printf("%d %s\n", a.b, argv[0]);
(gdb) p a
Attempt to use a type name as an expression
(gdb) ptype a
type = class a {
public:
int b;
a & operator=(a const &);
a(a const &);
a(void);
}
(gdb) c
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: