This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Use generic_print_address for address
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 11 Feb 2005 16:23:20 -0800
- Subject: Re: PATCH: Use generic_print_address for address
- References: <20050211233154.GA10866@lucon.org> <jewttemztr.fsf@sykes.suse.de> <20050211234902.GA11119@lucon.org> <jesm42mz2z.fsf@sykes.suse.de>
On Sat, Feb 12, 2005 at 12:55:16AM +0100, Andreas Schwab wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
>
> > On Sat, Feb 12, 2005 at 12:39:12AM +0100, Andreas Schwab wrote:
> >> "H. J. Lu" <hjl@lucon.org> writes:
> >>
> >> > + info->fprintf_func (info->stream, _("Address 0x"));
> >> > + generic_print_address (memaddr, info);
> >> > + info->fprintf_func (info->stream, _(" is out of bounds.\n"));
> >>
> >> This is very i18n unfriendly.
> >>
> >
> > Do you have any suggestions?
>
> If there is a way to format the address into a buffer then the format
> string can be combined again.
>
Like this?
H.J.
----
2005-02-11 H.J. Lu <hongjiu.lu@intel.com>
* dis-buf.c (perror_memory): Use sprintf_vma to print out
address.
--- opcodes/dis-buf.c.vma 2003-11-17 12:30:30.000000000 -0800
+++ opcodes/dis-buf.c 2005-02-11 16:20:38.508542555 -0800
@@ -56,10 +56,15 @@ perror_memory (status, memaddr, info)
/* Can't happen. */
info->fprintf_func (info->stream, _("Unknown error %d\n"), status);
else
- /* Actually, address between memaddr and memaddr + len was
- out of bounds. */
- info->fprintf_func (info->stream,
- _("Address 0x%x is out of bounds.\n"), memaddr);
+ {
+ char buf[30];
+
+ /* Actually, address between memaddr and memaddr + len was
+ out of bounds. */
+ sprintf_vma (buf, memaddr);
+ info->fprintf_func (info->stream,
+ _("Address 0x%s is out of bounds.\n"), buf);
+ }
}
/* This could be in a separate file, to save miniscule amounts of space