This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] MIPS: Provide FPU info and decode FCSR in `info float'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]