This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] MIPS: Provide FPU info and decode FCSR in `info float'
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Wed, 17 Dec 2014 10:53:18 +0000
- Subject: Re: [PATCH 3/3] MIPS: Provide FPU info and decode FCSR in `info float'
- Authentication-results: sourceware.org; auth=none
- References: <1418798765-23198-1-git-send-email-yao at codesourcery dot com> <1418798765-23198-4-git-send-email-yao at codesourcery dot com>
On 12/17/2014 06:46 AM, Yao Qi 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.
> +
> + fprintf_filtered (file, "fpu type: %s\n",
> + type == MIPS_FPU_DOUBLE ? "double-precision"
> + : type == MIPS_FPU_SINGLE ? "single-precision"
> + : "none / unused");
> +
> + if (type == MIPS_FPU_NONE)
> + return;
> +
Thanks,
Pedro Alves