From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <yao@codesourcery.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/3] MIPS: Provide FPU info and decode FCSR in `info float'
Date: Sun, 21 Dec 2014 00:14:00 -0000 [thread overview]
Message-ID: <alpine.DEB.1.10.1412202355440.19155@tp.orcam.me.uk> (raw)
In-Reply-To: <5491609E.1080204@redhat.com>
On Wed, 17 Dec 2014, Pedro Alves wrote:
> > +static void
> > +mips_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
> > + struct frame_info *frame, const char *args)
> > +{
> > + int fcsr = mips_regnum (gdbarch)->fp_control_status;
> > + enum mips_fpu_type type = MIPS_FPU_TYPE (gdbarch);
> > + ULONGEST fcs = 0;
> > + int i;
> > +
> > + if (fcsr == -1 || !deprecated_frame_register_read (frame, fcsr, NULL))
> > + type = MIPS_FPU_NONE;
>
> "deprecated" method usage alert. It's better to use methods that return
> values and then print "<unsaved>", "<unavailable>" as appropriate,
> though in this case you may be able to just use read_frame_register_unsigned
> instead.
For the record, we use `get_frame_register_unsigned' in such cases
elsewhere, e.g. `micromips_bc1_pc' and we don't expect it to fail on the
assumption that `fp_control_status' will have been set correctly. I see
this change went in already, but I'd like to see it updated with a
follow-up change for consistency.
Specifically `get_frame_register_unsigned' is unsuitable here (as we want
to poke at the actual register file, not the frame state), but I think a
failure from `read_frame_register_unsigned' should be signalled as an
error (exception being thrown, just as from the former function) rather
than being silently treated as if there were no FPU.
Also I think the registers should be dumped earlier on, with only generic
FPU parameters preceding, as the extra decoded FCSR information is an
elaboration of raw register contents, so I find it logical (as far as the
reading flow of English text is considered) to be presented later, i.e.:
fpu type: ...
reg size: ...
[registers]
cond : ...
[...]
Or so I think. It would help reviewing it if the updated version of the
patch was presented with corresponding output produced accompanying, just
as I did with the original version. Otherwise it requires drawing the
output in one's head which is not necessarily straightforward.
Maciej
next prev parent reply other threads:[~2014-12-21 0:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 6:46 [PATCH 0/3, V2] " Yao Qi
2014-12-17 6:46 ` [PATCH 1/3] Remove h8300_print_float_info Yao Qi
2014-12-17 6:46 ` [PATCH 3/3] MIPS: Provide FPU info and decode FCSR in `info float' Yao Qi
2014-12-17 10:53 ` Pedro Alves
2014-12-17 12:40 ` Yao Qi
2014-12-18 1:07 ` Yao Qi
2014-12-18 11:16 ` Pedro Alves
2014-12-21 0:14 ` Maciej W. Rozycki [this message]
2014-12-17 6:46 ` [PATCH 2/3] Refactor gdbarch method print_float_info Yao Qi
2014-12-17 13:24 ` Pedro Alves
2014-12-18 1:02 ` Yao Qi
2014-12-18 11:14 ` Pedro Alves
2014-12-18 12:52 ` [PATCH 0/3, V2] MIPS: Provide FPU info and decode FCSR in `info float' Yao Qi
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=alpine.DEB.1.10.1412202355440.19155@tp.orcam.me.uk \
--to=macro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=yao@codesourcery.com \
/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