From d855c300c716ddddc5e278bfa644c8939b52e19b Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 11 Jun 2002 02:30:59 +0000 Subject: [PATCH] Make print_float_info() multi-arch pure. Add ui_file and frame parameters. --- gdb/ChangeLog | 10 ++++++++++ gdb/arch-utils.c | 6 ++++-- gdb/arch-utils.h | 4 +++- gdb/arm-tdep.c | 3 ++- gdb/gdbarch.c | 20 +++++--------------- gdb/gdbarch.h | 17 ++--------------- gdb/gdbarch.sh | 2 +- gdb/infcmd.c | 2 +- 8 files changed, 28 insertions(+), 36 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ad2d6e78a46..9c920e31dfe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2002-06-10 Andrew Cagney + + * gdbarch.sh (PRINT_FLOAT_INFO): Add frame and ui_file parameters. + Make multi-arch pure. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-tdep.c (arm_print_float_info): Update. + * arch-utils.h (default_print_float_info): Update. + * arch-utils.c (default_print_float_info): Update. + * infcmd.c (float_info): Update call. + 2002-06-10 Andrew Cagney * Makefile.in (init.c): Move the call to _initialize_gdbtypes to diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 8e69a6127ad..887aa9d7223 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -241,7 +241,8 @@ default_double_format (struct gdbarch *gdbarch) } void -default_print_float_info (void) +default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame) { #ifdef FLOAT_INFO #if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL @@ -249,7 +250,8 @@ default_print_float_info (void) #endif FLOAT_INFO; #else - printf_filtered ("No floating point info available for this processor.\n"); + fprintf_filtered (file, "\ +No floating point info available for this processor.\n"); #endif } diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 3b3e615ffc3..0b397af82d4 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -142,7 +142,9 @@ extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name); extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc); -extern void default_print_float_info (void); +extern void default_print_float_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame); /* Assume that the world is sane, a registers raw and virtual size both match its type. */ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 04fca2e44c6..1ce0a5b5667 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1558,7 +1558,8 @@ print_fpu_flags (int flags) /* Print interesting information about the floating point processor (if present) or emulator. */ static void -arm_print_float_info (void) +arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame) { register unsigned long status = read_register (ARM_FPS_REGNUM); int type; diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index bbf25f2c8f2..db66cd8d99b 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -321,7 +321,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, + default_print_float_info, 0, 0, 0, @@ -1532,21 +1532,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n", (long) current_gdbarch->prepare_to_proceed /*PREPARE_TO_PROCEED ()*/); -#endif -#ifdef PRINT_FLOAT_INFO -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PRINT_FLOAT_INFO()", - XSTRING (PRINT_FLOAT_INFO ())); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PRINT_FLOAT_INFO = 0x%08lx\n", - (long) current_gdbarch->print_float_info - /*PRINT_FLOAT_INFO ()*/); -#endif + "gdbarch_dump: print_float_info = 0x%08lx\n", + (long) current_gdbarch->print_float_info); #ifdef PROLOGUE_FRAMELESS_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -3007,7 +2997,7 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch, } void -gdbarch_print_float_info (struct gdbarch *gdbarch) +gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame) { gdb_assert (gdbarch != NULL); if (gdbarch->print_float_info == 0) @@ -3015,7 +3005,7 @@ gdbarch_print_float_info (struct gdbarch *gdbarch) "gdbarch: gdbarch_print_float_info invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); - gdbarch->print_float_info (); + gdbarch->print_float_info (gdbarch, file, frame); } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 7d77cf9e109..db8c3e10445 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -789,22 +789,9 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO) -#define PRINT_FLOAT_INFO() (default_print_float_info ()) -#endif - -typedef void (gdbarch_print_float_info_ftype) (void); -extern void gdbarch_print_float_info (struct gdbarch *gdbarch); +typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame); +extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame); extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO) -#error "Non multi-arch definition of PRINT_FLOAT_INFO" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO) -#define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch)) -#endif -#endif /* MAP a GDB RAW register number onto a simulator register number. See also include/...-sim.h. */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 52dfd1c71ec..c0e9586ce4b 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -468,7 +468,7 @@ f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_r v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1 f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0 f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0 -f:2:PRINT_FLOAT_INFO:void:print_float_info:void::::default_print_float_info::0 +m:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame:file, frame:::default_print_float_info::0 # MAP a GDB RAW register number onto a simulator register number. See # also include/...-sim.h. f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0 diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 400ac552d2d..6d3f7929de9 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1847,7 +1847,7 @@ interrupt_target_command (char *args, int from_tty) static void float_info (char *addr_exp, int from_tty) { - PRINT_FLOAT_INFO (); + gdbarch_print_float_info (current_gdbarch, gdb_stdout, selected_frame); } /* ARGSUSED */ -- 2.30.2