From: "Martin M. Hunt" <hunt@redhat.com>
To: bug-binutils@gnu.org
Cc: gdb@sources.redhat.com
Subject: gas (or maybe gdb/gcc) problem with o64 Mips and DWARF
Date: Wed, 12 Mar 2003 01:22:00 -0000 [thread overview]
Message-ID: <1047432166.1171.155.camel@Dragon> (raw)
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
reply other threads:[~2003-03-12 1:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1047432166.1171.155.camel@Dragon \
--to=hunt@redhat.com \
--cc=bug-binutils@gnu.org \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox