This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC v2][3/3] Target FP printing: Use floatformat_to_string in tdep code
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: macro at imgtec dot com (Maciej W. Rozycki)
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Oct 2017 15:18:11 +0200 (CEST)
- Subject: Re: [RFC v2][3/3] Target FP printing: Use floatformat_to_string in tdep code
- Authentication-results: sourceware.org; auth=none
> On Tue, 17 Oct 2017, Ulrich Weigand wrote:
> > I see. I guess we shouldn't use the special output strings at all
> > when using formatted printing, but rely on the underlying printer
> > to handle all cases. (This actually matches today's behavior of
> > printf_command, which my patches inadvertently changed.)
> >
> > Can you verify using this additional patch on top of the series?
>
> This indeed brings the original output back, although I think printing
> the NaN payload does have a value.
OK, thanks for confirming.
> Would it be a tough problem to have it printed according to the width
> requested in the format specifier? We know it's always going to take less
> than the maximum required for a floating-point number of the same
> floating-point format.
I'm not sure I like adding (more of) a format parser here, that would
need deciding which parts of the format to act on and which not ...
If you'd like to see this in the mips output, maybe this can be done
in the tdep file: go back to using the print routine *without* format
string, and then print the resulting string using %s with a width
specifier.
> As an independent change I think it would best be made with a separate
> patch though.
Agreed.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com