Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gas (or maybe gdb/gcc) problem with o64 Mips and DWARF
@ 2003-03-12  1:22 Martin M. Hunt
  0 siblings, 0 replies; only message in thread
From: Martin M. Hunt @ 2003-03-12  1:22 UTC (permalink / raw)
  To: bug-binutils; +Cc: gdb

I don't understand how to fix this, but here's what I'm seeing.

Configuring and building for mips64-elf.  The default abi is o64 which
has 32-bit pointers. I cannot debug anything because GDB cannot
correctly read the linetable.  readelf can read it but dwarfdump cannot.
Looking more carefully, I see that 
DW_LNE_set_address has a 64-bit address, but the compilation units all
set the address size to 32 bits.  This causes a problem for GDB's dwarf
reader.

To reproduce the problem, compile any small program with mips64-elf-gcc
then attempt to debug with gdb or insight.  Line numbers will either be
nonexistent or incorrect.

The problem appears to be in gas/dwarf2dbg.c in function dwarf2_finish()
which has the following:

 /* Calculate the size of an address for the target machine.  */
  sizeof_address = bfd_arch_bits_per_address (stdoutput) / 8;

So gas is not getting address size from the compilation unit header, but
from the architecture, which for mips64-elf is "mips:4000".  So how
should this work?  I cannot see how to grab info from the CU header. And
I don't know how else to find out from GCC what size a pointer is.

(What happens if I add "-mlong64" to the compile line?  Now gcc
generates CUs with 64-bit addresses and gas agrees and all works well.)

Martin







^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-12  1:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-12  1:22 gas (or maybe gdb/gcc) problem with o64 Mips and DWARF Martin M. Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox