This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix cross-endian DFP for GDB
On Fri, 27 Jun 2008, Daniel Jacobowitz wrote:
> On Fri, Jun 27, 2008 at 05:40:45PM +0000, Joseph S. Myers wrote:
> > 2008-06-27 Joseph Myers <joseph@codesourcery.com>
> >
> > * dfp.c (decimal_convert): Call match_endianness before and after
> > conversion.
>
> Does promote_decimal have the same problem?
Both callers of promote_decimal call match_endianness beforehand. Thus
the promote_decimal interface is that it uses host endianness.
> I'm wondering why the calls can't go in decimal_to_number /
> decimal_from_number... (resp. decimal_to_string).
I imagine almost any choice of which set of functions use host endianness
and which use target endianness would work. Given that which use which
endianness isn't documented, and nor is an underlying design, I kept the
existing interface for what is passed to/from each function and did the
minimal change to make it work.
--
Joseph S. Myers
joseph@codesourcery.com