This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/408: [DWARF2] : Alignment breaks displaying floating point value
- From: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 8 Mar 2002 20:28:01 -0000
- Subject: Re: gdb/408: [DWARF2] : Alignment breaks displaying floating point value
- Reply-to: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
The following reply was made to PR gdb/408; it has been noted by GNATS.
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: pavenis@latnet.lv
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/408: [DWARF2] : Alignment breaks displaying floating point value
Date: Fri, 8 Mar 2002 21:22:20 MET
This is a gcc-3.x bug, not a GDB bug.
If you add the following statement to your example
printf ("%d\n",(char *)&bar.c - (char *)&bar.a);
and run it, you will note that the offset of the `c' member is 12 bytes.
But when you compile your example with -S -dA and examine the resulting
assembler file, you will find:
.uleb128 0x3 / (DIE (0x147) DW_TAG_member)
.ascii "c\0" / DW_AT_name
.byte 0x1 / DW_AT_decl_file
.byte 0x5 / DW_AT_decl_line
.long 0x184 / DW_AT_type
.byte 0x2 / DW_AT_data_member_location
.byte 0x23 / DW_OP_plus_uconst
.uleb128 0x10
-----------------^
which is incorrectly telling GDB that the `c' member is at offset 16.
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de