From: Fred Fish <fnf@intrinsity.com>
To: gdb-patches@sources.redhat.com
Cc: fnf@intrinsity.com
Subject: [RFC] Another 64 bit CORE_ADDR & 32 bit target address printing botch
Date: Sat, 07 Sep 2002 21:34:00 -0000 [thread overview]
Message-ID: <200209080433.g884XU302357@beeville.vert.intrinsity.com> (raw)
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);
}
next reply other threads:[~2002-09-08 4:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-07 21:34 Fred Fish [this message]
2002-09-09 9:28 ` Kevin Buettner
2002-09-09 12:36 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200209080433.g884XU302357@beeville.vert.intrinsity.com \
--to=fnf@intrinsity.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox