From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20668 invoked by alias); 31 May 2006 23:25:49 -0000 Received: (qmail 20660 invoked by uid 22791); 31 May 2006 23:25:49 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 May 2006 23:25:46 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4VNPi3I001563; Wed, 31 May 2006 19:25:44 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4VNPc2U020744; Wed, 31 May 2006 19:25:38 -0400 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id k4VNPa8w032674; Wed, 31 May 2006 19:25:37 -0400 Message-ID: <447E25F0.3010009@redhat.com> Date: Wed, 31 May 2006 23:32:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) MIME-Version: 1.0 To: brobecker@adacore.com, GDB Patches , fnf@specifics.com Subject: [RFA] mips, eabi64, addr_bit == 32 Content-Type: multipart/mixed; boundary="------------020109030106030809060904" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00485.txt.bz2 This is a multi-part message in MIME format. --------------020109030106030809060904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 379 Disagreement between gcc and gdb about the size of an addr causes numerous dwarf2-related complaints of the form: (gdb) advance foo^M foo (a=dwarf2_read_address: Corrupted DWARF expression.^M ) at /opt/redhat/gnupro-06r1-1/sources/tools/cross/gdb/testsuite/gdb.base/advan\ce.c:6^M 6 int b = a + 10;^M (gdb) FAIL: gdb.base/advance.exp: advance function called as param --------------020109030106030809060904 Content-Type: text/plain; name="d2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="d2" Content-length: 1265 2006-05-31 Michael Snyder * mips-tdep.c (mips_gdbarch_init): EABI64, addr_bit is 32. (mips_write_pc): Difference between addr_bit and ptr_bit requires sign_extension when setting $pc. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.393 diff -p -r1.393 mips-tdep.c *** mips-tdep.c 31 May 2006 23:15:50 -0000 1.393 --- mips-tdep.c 31 May 2006 23:18:47 -0000 *************** mips_unwind_dummy_id (struct gdbarch *gd *** 838,843 **** --- 838,847 ---- static void mips_write_pc (CORE_ADDR pc, ptid_t ptid) { + /* If addr_bit is 32, force sign extension. */ + if (gdbarch_addr_bit (current_gdbarch) == 32) + if ((pc & 0xffffffff80000000LL) == 0x80000000) + pc |= 0xffffffff00000000LL; write_register_pid (mips_regnum (current_gdbarch)->pc, pc, ptid); } *************** mips_gdbarch_init (struct gdbarch_info i *** 4976,4981 **** --- 4980,4986 ---- tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 64); set_gdbarch_ptr_bit (gdbarch, 64); + set_gdbarch_addr_bit (gdbarch, 32); set_gdbarch_long_long_bit (gdbarch, 64); break; case MIPS_ABI_N32: --------------020109030106030809060904--