From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11632 invoked by alias); 12 Mar 2003 01:22:44 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11625 invoked from network); 12 Mar 2003 01:22:44 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 12 Mar 2003 01:22:44 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h2C1MiQ21716 for ; Tue, 11 Mar 2003 20:22:44 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h2C1MiV22403; Tue, 11 Mar 2003 20:22:44 -0500 Received: from dragon (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h2C1MhS27446; Tue, 11 Mar 2003 20:22:43 -0500 Subject: gas (or maybe gdb/gcc) problem with o64 Mips and DWARF From: "Martin M. Hunt" To: bug-binutils@gnu.org Cc: gdb@sources.redhat.com Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 12 Mar 2003 01:22:00 -0000 Message-Id: <1047432166.1171.155.camel@Dragon> Mime-Version: 1.0 X-SW-Source: 2003-03/txt/msg00170.txt.bz2 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