From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13295 invoked by alias); 25 Oct 2007 14:10:40 -0000 Received: (qmail 13278 invoked by uid 22791); 25 Oct 2007 14:10:38 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 Oct 2007 14:10:31 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1Il3Po-0004nE-00; Thu, 25 Oct 2007 15:10:28 +0100 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1Il3Pg-0000Yc-00; Thu, 25 Oct 2007 15:10:20 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1Il3Pg-00010A-3p; Thu, 25 Oct 2007 15:10:20 +0100 Date: Thu, 25 Oct 2007 14:43:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: David Ung , "Maciej W. Rozycki" Subject: mips-tdep.c: Sign-extend pointers for n32 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00653.txt.bz2 Hello, The change below fixes a few regressions in the GDB test suite for MIPS/n32 like the one below: print (diamond.*left_base_vpmf) () UNPREDICTABLE: PC = 0x80020580 Quit (gdb) FAIL: gdb.cp/member-ptr.exp: print (diamond.*left_base_vpmf) () Tested for n32 using the mipsisa32-sde-elf target, with the mips-sim-sde64/-mips64/-EB and mips-sim-sde64/-mips64/-EL boards, fixing 6 regressions (of 78) for the former and 3 regressions (of 74) for the latter. 2007-10-25 David Ung * mips-tdep.c (mips_n32n64_push_dummy_call): Sign-extend the pointer value if the length of the variable is less than the width of the register size of the ABI. OK to apply? Maciej 12741-0.diff Index: binutils-quilt/src/gdb/mips-tdep.c =================================================================== --- binutils-quilt.orig/src/gdb/mips-tdep.c 2007-09-21 17:19:38.000000000 +0100 +++ binutils-quilt/src/gdb/mips-tdep.c 2007-09-21 17:19:38.000000000 +0100 @@ -3032,6 +3032,10 @@ || typecode == TYPE_CODE_UNION)) regval <<= ((MIPS64_REGSIZE - partial_len) * TARGET_CHAR_BIT); + /* Sign extend the value if it is an address. */ + else if (partial_len < MIPS64_REGSIZE + && typecode == TYPE_CODE_PTR) + regval = extract_signed_integer (val, partial_len); if (mips_debug) fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",