Bug 7737 - g++ compiled struct structname structname; => can't eval structname.
Summary: g++ compiled struct structname structname; => can't eval structname.
Status: RESOLVED DUPLICATE of bug 16253
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: HEAD
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 15111 (view as bug list)
Depends on:
Blocks: 16106
  Show dependency treegraph
 
Reported: 2002-08-06 02:18 UTC by rbrown64
Modified: 2015-06-03 16:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2010-10-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rbrown64 2002-08-06 09:18:00 UTC
[Converted from Gnats 632]

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

Release:
gdb-5.2

Environment:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs  
gcc version 2.95.2 20000220 (Debian GNU/Linux)
Comment 1 Ben Longbons 2013-07-30 06:34:21 UTC
*** Bug 15111 has been marked as a duplicate of this bug. ***
Comment 2 Jason Merrill 2015-06-03 16:09:06 UTC
16253 has more information.

*** This bug has been marked as a duplicate of bug 16253 ***