aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-15 23:41:20 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-15 23:41:20 +0000
commit23e3a7ac79ad6f6648bd99602ba715874ce9ac9a (patch)
treeaeb8f594b82b8208465506f08189bc44ca618e88 /gdb
parent8de397a5ad45db45f00ce9b58c2b8b2d7b5aa765 (diff)
downloadgdb-23e3a7ac79ad6f6648bd99602ba715874ce9ac9a.zip
gdb-23e3a7ac79ad6f6648bd99602ba715874ce9ac9a.tar.gz
gdb-23e3a7ac79ad6f6648bd99602ba715874ce9ac9a.tar.bz2
2002-08-15 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method. Add `args' parameter. * gdbarch.h, gdbarch.c: Regenerate. * arm-tdep.c (arm_print_float_info): Add the parameter `args'. * infcmd.c (float_info): Call print_float_info. (print_float_info): New function. By default, print the floating-point registers. * arch-utils.h (default_print_float_info): Delete declaration. * arch-utils.c (default_print_float_info): Delete function.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/arch-utils.c15
-rw-r--r--gdb/arch-utils.h4
-rw-r--r--gdb/arm-tdep.c2
-rw-r--r--gdb/gdbarch.c16
-rw-r--r--gdb/gdbarch.h6
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/infcmd.c39
8 files changed, 69 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e7bf8cd..42ed728 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2002-08-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method.
+ Add `args' parameter.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * arm-tdep.c (arm_print_float_info): Add the parameter `args'.
+
+ * infcmd.c (float_info): Call print_float_info.
+ (print_float_info): New function. By default, print the
+ floating-point registers.
+
+ * arch-utils.h (default_print_float_info): Delete declaration.
+ * arch-utils.c (default_print_float_info): Delete function.
+
2002-08-16 Mark Kettenis <kettenis@gnu.org>
* config/i386/nm-i386v.h (FLOAT_INFO): Remove already commented
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 5497e83..170be86 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -250,21 +250,6 @@ default_double_format (struct gdbarch *gdbarch)
}
}
-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
-#error "FLOAT_INFO defined in multi-arch"
-#endif
- FLOAT_INFO;
-#else
- fprintf_filtered (file, "\
-No floating point info available for this processor.\n");
-#endif
-}
-
/* Misc helper functions for targets. */
int
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index a38272c..5fb3ece 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -146,10 +146,6 @@ 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 (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 ba213ae..037598d 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1585,7 +1585,7 @@ print_fpu_flags (int flags)
(if present) or emulator. */
static void
arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
- struct frame_info *frame)
+ struct frame_info *frame, const char *args)
{
register unsigned long status = read_register (ARM_FPS_REGNUM);
int type;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e2e5b7b..abc7483 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -322,7 +322,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- default_print_float_info,
+ 0,
0,
0,
0,
@@ -490,7 +490,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->register_virtual_size = generic_register_size;
current_gdbarch->max_register_virtual_size = -1;
current_gdbarch->do_registers_info = do_registers_info;
- current_gdbarch->print_float_info = default_print_float_info;
current_gdbarch->register_sim_regno = legacy_register_sim_regno;
current_gdbarch->cannot_fetch_register = cannot_register_not;
current_gdbarch->cannot_store_register = cannot_register_not;
@@ -637,7 +636,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
&& (gdbarch->register_virtual_type == 0))
fprintf_unfiltered (log, "\n\tregister_virtual_type");
/* Skip verify of do_registers_info, invalid_p == 0 */
- /* Skip verify of print_float_info, invalid_p == 0 */
+ /* Skip verify of print_float_info, has predicate */
/* Skip verify of register_sim_regno, invalid_p == 0 */
/* Skip verify of register_bytes_ok, has predicate */
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
@@ -2994,8 +2993,15 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
gdbarch->do_registers_info = do_registers_info;
}
+int
+gdbarch_print_float_info_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->print_float_info != 0;
+}
+
void
-gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame)
+gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->print_float_info == 0)
@@ -3003,7 +3009,7 @@ gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct
"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, file, frame);
+ gdbarch->print_float_info (gdbarch, file, frame, args);
}
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 973f250..7857b09 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -795,8 +795,10 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r
#endif
#endif
-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 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);
/* MAP a GDB RAW register number onto a simulator register number. See
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index f416aea..d5e0e9c 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
-m:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame:file, frame:::default_print_float_info::0
+M:2:PRINT_FLOAT_INFO:void:print_float_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.
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 83267ad..42bb532 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1845,9 +1845,44 @@ interrupt_target_command (char *args, int from_tty)
/* ARGSUSED */
static void
-float_info (char *addr_exp, int from_tty)
+print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
- gdbarch_print_float_info (current_gdbarch, gdb_stdout, selected_frame);
+ if (gdbarch_print_float_info_p (gdbarch))
+ gdbarch_print_float_info (gdbarch, file, frame, args);
+ else
+ {
+#ifdef FLOAT_INFO
+#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
+#error "FLOAT_INFO defined in multi-arch"
+#endif
+ FLOAT_INFO;
+#else
+ int regnum;
+ int printed_something = 0;
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
+ {
+ printed_something = 1;
+#if 0
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
+#else
+ do_registers_info (regnum, 1);
+#endif
+ }
+ }
+ if (!printed_something)
+ fprintf_filtered (file, "\
+No floating-point info available for this processor.\n");
+#endif
+ }
+}
+
+static void
+float_info (char *args, int from_tty)
+{
+ print_float_info (current_gdbarch, gdb_stdout, selected_frame, args);
}
/* ARGSUSED */