This is the mail archive of the gdb-prs@sources.redhat.com 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]

gdb/1883: no access to members of unnamed structs possible


>Number:         1883
>Category:       gdb
>Synopsis:       no access to members of unnamed structs possible
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 01 21:58:02 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     gpiez@web.de
>Release:        GNU gdb 6.3
>Organization:
>Environment:
Linux cruncher 2.6.9-gentoo-r14 #6 Tue Mar 1 21:09:07 CET 2005 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux
gcc version 3.4.3 20050110 (Gentoo Linux 3.4.3.20050110, ssp-3.4.3.20050110-0, pie-8.7.7)
This GDB was configured as "x86_64-pc-linux-gnu".
>Description:
It is not possible to print out the value of members of unnamed structs (possibly unions too).

Bug existed at least in 6.0.
>How-To-Repeat:
gpiez@cruncher ~ $ cat test.c
union {
    int all;
    struct {
        char part1;
        char part2;
    };
} foobar = { .all = 257 };

main() {
    printf("%d\n", foobar.all);
    printf("%d\n", foobar.part1);
}
gpiez@cruncher ~ $ gcc -g -o test test.c
gpiez@cruncher ~ $ ./test
257
1
gpiez@cruncher ~ $ gdb test
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) print foobar.all
$1 = 257
(gdb) print foobar.part1
There is no member named part1.
(gdb) 
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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