aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-06-02 01:59:13 +0000
committerAndrew Cagney <cagney@redhat.com>2000-06-02 01:59:13 +0000
commitf0d4cc9e0ec5ad1533782d32bbf5029b2601828f (patch)
tree694515271aab5920d4cf655104b857ff03479e1a /gdb/gdbarch.c
parent1b3739704ea05cca80c0401d4b33ad3dc625e6f4 (diff)
downloadgdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.zip
gdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.tar.gz
gdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.tar.bz2
Multiarch TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT,
TARGET_LONG_DOUBLE_FORMAT. Update d10v.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index bcad7b9..2c90782 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -58,6 +58,7 @@
#endif
#include "symcat.h"
+#include "floatformat.h"
/* Static function declarations */
@@ -220,6 +221,9 @@ struct gdbarch
gdbarch_stack_align_ftype *stack_align;
gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
+ const struct floatformat * float_format;
+ const struct floatformat * double_format;
+ const struct floatformat * long_double_format;
};
@@ -331,6 +335,9 @@ struct gdbarch startup_gdbarch = {
0,
0,
0,
+ 0,
+ 0,
+ 0,
/* startup_gdbarch() */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
@@ -637,6 +644,12 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of stack_align, has predicate */
/* Skip verify of reg_struct_has_addr, has predicate */
/* Skip verify of save_dummy_frame_tos, has predicate */
+ if (gdbarch->float_format == 0)
+ gdbarch->float_format = default_float_format (gdbarch);
+ if (gdbarch->double_format == 0)
+ gdbarch->double_format = default_double_format (gdbarch);
+ if (gdbarch->long_double_format == 0)
+ gdbarch->long_double_format = &floatformat_unknown;
}
@@ -1185,6 +1198,21 @@ gdbarch_dump (void)
(long) current_gdbarch->save_dummy_frame_tos
/*SAVE_DUMMY_FRAME_TOS ()*/);
#endif
+#ifdef TARGET_FLOAT_FORMAT
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: TARGET_FLOAT_FORMAT = %ld\n",
+ (long) TARGET_FLOAT_FORMAT);
+#endif
+#ifdef TARGET_DOUBLE_FORMAT
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: TARGET_DOUBLE_FORMAT = %ld\n",
+ (long) TARGET_DOUBLE_FORMAT);
+#endif
+#ifdef TARGET_LONG_DOUBLE_FORMAT
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
+ (long) TARGET_LONG_DOUBLE_FORMAT);
+#endif
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: GDB_MULTI_ARCH = %d\n",
GDB_MULTI_ARCH);
@@ -2820,6 +2848,51 @@ set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
}
+const struct floatformat *
+gdbarch_float_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
+ return gdbarch->float_format;
+}
+
+void
+set_gdbarch_float_format (struct gdbarch *gdbarch,
+ const struct floatformat * float_format)
+{
+ gdbarch->float_format = float_format;
+}
+
+const struct floatformat *
+gdbarch_double_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
+ return gdbarch->double_format;
+}
+
+void
+set_gdbarch_double_format (struct gdbarch *gdbarch,
+ const struct floatformat * double_format)
+{
+ gdbarch->double_format = double_format;
+}
+
+const struct floatformat *
+gdbarch_long_double_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
+ return gdbarch->long_double_format;
+}
+
+void
+set_gdbarch_long_double_format (struct gdbarch *gdbarch,
+ const struct floatformat * long_double_format)
+{
+ gdbarch->long_double_format = long_double_format;
+}
+
/* Keep a registrary of per-architecture data-pointers required by GDB
modules. */