This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Tracing for floating point values
- To: Ben Elliston <bje at redhat dot com>
- Subject: Re: Tracing for floating point values
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 15 Dec 2000 11:54:08 +1100
- Cc: CGEN <cgen at sources dot redhat dot com>, gdb at sources dot redhat dot com
- References: <Pine.LNX.4.31.0012090940090.22164-100000@moshpit.cygnus.com>
Ben Elliston wrote:
>
> Currently, the TRACE_RESULTS web of macros/functions in
> sim/common/cgen-trace.c don't know how to handle the 'f' printf-type for SF
> and DF operands. Only 'D' and 'x' are handled at present.
>
> I set about fixing this yesterday. There were two approaches I considered:
>
> * use the host's native printf %x. Comments in sim-fpu.[hc]
> indicate this is a bad mistake. There's no guarantee that the
> host will use the same floating point representation as the
> target.
You would need to be very careful about SNaNs.
> * use sim_fpu's sim_fpu_print_fpu to output the real number
> using cgen_trace_printf as its callback (which works nicely).
> However, we get very detailed output!
>
> fr <- +1.0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000*2^+0
>
> Which way seems right to jump?
What about a print function that outputs things in decimal - something
like ``%f'' or ``%g''. While the existing print function is really
useful for someone debugging the internals it isn't much use to normal
users.
Andrew