From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27966 invoked by alias); 26 Mar 2007 13:19:52 -0000 Received: (qmail 27949 invoked by uid 22791); 26 Mar 2007 13:19:51 -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; Mon, 26 Mar 2007 14:19:46 +0100 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 1HVp6t-00022N-00; Mon, 26 Mar 2007 14:19:43 +0100 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1HVp6O-0003DN-00; Mon, 26 Mar 2007 14:19:12 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1HVp6O-0002Yx-3w; Mon, 26 Mar 2007 14:19:12 +0100 Date: Mon, 26 Mar 2007 13:19:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Nigel Stephens , "Maciej W. Rozycki" Subject: ui-out.c: Truncate address like deprecated_print_address_numeric() 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-03/txt/msg00229.txt.bz2 Hello, The following change fixes this test case failure: break *0x80020278 Breakpoint 3 at 0x80020278: file /n/bank/raid/macro/src7-mdi/combined/gdb/testsuite/gdb.base/consecutive.c, line 10. (gdb) PASS: gdb.base/consecutive.exp: set bp, 2nd instr step Breakpoint 3, 0xffffffff80020278 in foo () at /n/bank/raid/macro/src7-mdi/combined/gdb/testsuite/gdb.base/consecutive.c:10 10 return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6]; (gdb) FAIL: gdb.base/consecutive.exp: stopped at bp, 2nd instr (wrong address) This change has been tested natively for mips-unknown-linux-gnu and remotely for mipsisa32-sde-elf, using mips-sim-sde32/-EB and mips-sim-sde32/-EL as the targets, with no regressions for the former and removing the failure for the two latters. 2007-03-26 Nigel Stephens Maciej W. Rozycki * ui-out.c (ui_out_field_core_addr): Truncate address to TARGET_ADDR_BIT size before printing. OK to apply? Maciej 12110-0.diff Index: binutils-quilt/src/gdb/ui-out.c =================================================================== --- binutils-quilt.orig/src/gdb/ui-out.c 2007-03-26 14:11:41.000000000 +0100 +++ binutils-quilt/src/gdb/ui-out.c 2007-03-26 14:15:45.000000000 +0100 @@ -493,12 +493,17 @@ CORE_ADDR address) { char addstr[20]; + int addr_bit = TARGET_ADDR_BIT; + + /* Truncate address to match deprecated_print_address_numeric(). */ + if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)) + address &= ((CORE_ADDR) 1 << addr_bit) - 1; /* FIXME: cagney/2002-05-03: Need local_address_string() function that returns the language localized string formatted to a width based on TARGET_ADDR_BIT. */ /* deprecated_print_address_numeric (address, 1, local_stream); */ - if (TARGET_ADDR_BIT <= 32) + if (addr_bit <= 32) strcpy (addstr, hex_string_custom (address, 8)); else strcpy (addstr, hex_string_custom (address, 16));