+2014-12-18 Yao Qi <yao@codesourcery.com>
+
+ * gdbarch.sh (print_float_info): Change its type from 'M' to 'm'.
+ * gdbarch.c: Re-generated.
+ * gdbarch.h: Likewise.
+ * infcmd.c (default_print_float_info): New function.
+ (print_float_info): Removed. Move code to
+ default_print_float_info.
+ (float_info): Adjust to call gdbarch_print_float_info.
+ * inferior.h (default_print_float_info): Declare it.
+
2014-12-18 Yao Qi <yao@codesourcery.com>
* h8300-tdep.c (h8300_print_float_info): Remove.
gdbarch->deprecated_fp_regnum = -1;
gdbarch->call_dummy_location = AT_ENTRY_POINT;
gdbarch->print_registers_info = default_print_registers_info;
+ gdbarch->print_float_info = default_print_float_info;
gdbarch->register_sim_regno = legacy_register_sim_regno;
gdbarch->cannot_fetch_register = cannot_register_not;
gdbarch->cannot_store_register = cannot_register_not;
/* Skip verify of call_dummy_location, invalid_p == 0 */
/* Skip verify of push_dummy_code, has predicate. */
/* Skip verify of print_registers_info, invalid_p == 0 */
- /* Skip verify of print_float_info, has predicate. */
+ /* Skip verify of print_float_info, invalid_p == 0 */
/* Skip verify of print_vector_info, has predicate. */
/* Skip verify of register_sim_regno, invalid_p == 0 */
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
fprintf_unfiltered (file,
"gdbarch_dump: pointer_to_address = <%s>\n",
host_address_to_string (gdbarch->pointer_to_address));
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
- gdbarch_print_float_info_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: print_float_info = <%s>\n",
host_address_to_string (gdbarch->print_float_info));
gdbarch->print_registers_info = print_registers_info;
}
-int
-gdbarch_print_float_info_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->print_float_info != NULL;
-}
-
void
gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
{
extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
-extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
-
typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
M:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache
m:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all::default_print_registers_info::0
-M:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+m:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args::default_print_float_info::0
M:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
}
}
-static void
-print_float_info (struct ui_file *file,
- struct frame_info *frame, const char *args)
+/* See inferior.h. */
+
+void
+default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ int regnum;
+ int printed_something = 0;
- if (gdbarch_print_float_info_p (gdbarch))
- gdbarch_print_float_info (gdbarch, file, frame, args);
- else
+ for (regnum = 0;
+ regnum < gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch);
+ regnum++)
{
- int regnum;
- int printed_something = 0;
-
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
{
- if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
- {
- printed_something = 1;
- gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
- }
+ printed_something = 1;
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
}
- if (!printed_something)
- fprintf_filtered (file, "No floating-point info "
- "available for this processor.\n");
}
+ if (!printed_something)
+ fprintf_filtered (file, "No floating-point info "
+ "available for this processor.\n");
}
static void
float_info (char *args, int from_tty)
{
+ struct frame_info *frame;
+
if (!target_has_registers)
error (_("The program has no registers now."));
- print_float_info (gdb_stdout, get_selected_frame (NULL), args);
+ frame = get_selected_frame (NULL);
+ gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
}
\f
static void
struct frame_info *frame,
int regnum, int all);
+/* Default implementation of gdbarch_print_float_info. Print
+ the values of all floating point registers. */
+
+extern void default_print_float_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ const char *args);
+
extern void child_terminal_info (struct target_ops *self, const char *, int);
extern void term_info (char *, int);