-fpack-struct problems with gdb 5.3

Daniel Jacobowitz drow@mvista.com
Mon Jun 30 15:06:00 GMT 2003


On Mon, Jun 30, 2003 at 12:46:07PM +0100, Matthew J Fletcher wrote:
> Hi,
> 
> i am using the gcc -fpack-struct flag with gcc2.96-82mdk to pack all 
> structures (needed to for some asm routines). the problem being
> is that gdb-5.3 does not correctly recognise the structs as packed and
> so displayes them as if they were not, (viewing the memory region shows
> what it should look like).
> 
> so may i ask can gdb view packed structs ?, is there a way to tell from the 
> ELF mapfile or any other objdump information that the compiler has poorly
> generated the debug info ?
> 
> or is there any way to investigate this further myself.

GCC up until 3.2.3 or so (I think) did not generate correct debuging
info for packed structures.  GDB can't work out the layout on its own;
it just trusts what it is told.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list