From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20299 invoked by alias); 8 Sep 2002 04:34:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20281 invoked from network); 8 Sep 2002 04:34:05 -0000 Received: from unknown (HELO mailhost.intrinsity.com) (208.246.32.130) by sources.redhat.com with SMTP; 8 Sep 2002 04:34:05 -0000 Received: from victoria.eng.evsx.com (victoria.eng.evsx.com [192.168.1.29]) by mailhost.intrinsity.com (Postfix) with ESMTP id A3F563F40D for ; Sat, 7 Sep 2002 23:34:04 -0500 (CDT) Received: from beeville.vert.intrinsity.com (beeville.vert.intrinsity.com [192.168.3.48]) by victoria.eng.evsx.com (8.10.1/8.10.1) with ESMTP id g884Y3005970; Sat, 7 Sep 2002 23:34:04 -0500 (CDT) From: Fred Fish Received: (from fnf@localhost) by beeville.vert.intrinsity.com (8.11.2/8.11.4) id g884XU302357; Sat, 7 Sep 2002 23:33:30 -0500 Message-Id: <200209080433.g884XU302357@beeville.vert.intrinsity.com> Subject: [RFC] Another 64 bit CORE_ADDR & 32 bit target address printing botch To: gdb-patches@sources.redhat.com Date: Sat, 07 Sep 2002 21:34:00 -0000 Cc: fnf@intrinsity.com Reply-To: fnf@intrinsity.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00111.txt.bz2 I found another place where 32 bit addresses with the MSB set are printed as 0xffffffffxxxxxxxx. I hacked around the problem with this patch, but it might not be the best place to do it. Any better ideas? -Fred Index: ui-out.c =================================================================== RCS file: /mips/newtools/fsf/gdb/gdb/ui-out.c,v retrieving revision 1.1.1.3 diff -c -r1.1.1.3 ui-out.c *** ui-out.c 2002/08/31 02:49:14 1.1.1.3 --- ui-out.c 2002/09/08 04:29:28 *************** *** 491,506 **** CORE_ADDR address) { char addstr[20]; /* 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. */ /* print_address_numeric (address, 1, local_stream); */ if (TARGET_ADDR_BIT <= 32) ! strcpy (addstr, local_hex_string_custom (address, "08l")); else ! strcpy (addstr, local_hex_string_custom (address, "016l")); ! ui_out_field_string (uiout, fldname, addstr); } --- 491,510 ---- CORE_ADDR address) { char addstr[20]; + char *fmt; /* 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. */ /* print_address_numeric (address, 1, local_stream); */ + if (TARGET_ADDR_BIT <= 32) ! fmt = "08l"; else ! fmt = "016l"; ! if (TARGET_ADDR_BIT < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)) ! address &= ((CORE_ADDR) 1 << TARGET_ADDR_BIT) - 1; ! strcpy (addstr, local_hex_string_custom (address, fmt)); ui_out_field_string (uiout, fldname, addstr); }