From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: ktietz70@googlemail.com, Kai.Tietz@onevision.com,
gdb-patches@sourceware.org
Subject: Re: [RFC] convert a host address to a string
Date: Tue, 13 Jan 2009 12:09:00 -0000 [thread overview]
Message-ID: <20090113120821.GZ24105@adacore.com> (raw)
In-Reply-To: <200901101421.n0AELbwx014532@brahms.sibelius.xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
Here is the patch that I ended checkin in...
2009-01-13 Mark Kettenis <kettenis@gnu.org>
* utils.c (host_address_to_string): Reimplement in a way that
avoids the cast of the address to long.
Tested on x86-linux and x86-windows. I also re-built the debugger
on Vista64, and used "set debug arch" to verify that it can print
host addresses.
--
Joel
[-- Attachment #2: utils.c.diff --]
[-- Type: text/plain, Size: 705 bytes --]
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.203
diff -u -p -r1.203 utils.c
--- utils.c 7 Jan 2009 12:11:07 -0000 1.203
+++ utils.c 13 Jan 2009 12:04:25 -0000
@@ -3071,10 +3071,7 @@ host_address_to_string (const void *addr
{
char *str = get_cell ();
- /* We could use the %p conversion specifier to sprintf if we had any
- way of knowing whether this host supports it. But the following
- should work on the Alpha and on 32 bit machines. */
- sprintf (str, "0x%lx", (unsigned long) addr);
+ xsnprintf (str, CELLSIZE, "0x%s", phex_nz ((uintptr_t) addr, sizeof (addr)));
return str;
}
prev parent reply other threads:[~2009-01-13 12:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-07 12:19 Joel Brobecker
2009-01-07 16:17 ` Mark Kettenis
2009-01-08 10:19 ` Joel Brobecker
2009-01-08 10:25 ` Kai Tietz
2009-01-08 10:48 ` Joel Brobecker
2009-01-08 11:02 ` Kai Tietz
2009-01-08 11:25 ` Joel Brobecker
2009-01-08 11:31 ` Kai Tietz
2009-01-08 12:49 ` Mark Kettenis
2009-01-08 12:54 ` Joel Brobecker
2009-01-08 13:04 ` Kai Tietz
2009-01-08 13:12 ` Mark Kettenis
2009-01-08 13:26 ` Mark Kettenis
2009-01-08 13:35 ` Kai Tietz
2009-01-08 13:42 ` Joel Brobecker
2009-01-08 14:04 ` Kai Tietz
2009-01-08 16:18 ` Mark Kettenis
2009-01-08 16:23 ` Kai Tietz
2009-01-09 9:57 ` Joel Brobecker
2009-01-09 10:05 ` Kai Tietz
2009-01-09 13:12 ` Joel Brobecker
2009-01-09 14:28 ` Kai Tietz
2009-01-10 7:12 ` Joel Brobecker
2009-01-10 13:31 ` Kai Tietz
2009-01-10 13:34 ` Kai Tietz
2009-01-10 13:58 ` Mark Kettenis
2009-01-10 14:04 ` Mark Kettenis
2009-01-10 14:15 ` Kai Tietz
2009-01-10 14:22 ` Mark Kettenis
2009-01-10 14:25 ` Kai Tietz
2009-01-11 13:31 ` Joel Brobecker
2009-01-11 13:53 ` Mark Kettenis
2009-01-13 12:09 ` Joel Brobecker [this message]
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=20090113120821.GZ24105@adacore.com \
--to=brobecker@adacore.com \
--cc=Kai.Tietz@onevision.com \
--cc=gdb-patches@sourceware.org \
--cc=ktietz70@googlemail.com \
--cc=mark.kettenis@xs4all.nl \
/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