aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/gdbarch.c16
-rw-r--r--gdb/gdbarch.h8
-rwxr-xr-xgdb/gdbarch.sh24
-rw-r--r--gdb/inferior.h21
-rw-r--r--gdb/valprint.c6
6 files changed, 36 insertions, 52 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2371b9a..b31feae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+Mon Apr 17 13:37:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Make multi-arch variable defaults, defaults for non-
+ multi-arch targets.
+ (TARGET_BFD_VMA_BIT, IEEE_FLOAT, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS): Update.
+
+ * inferior.h (CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS): Default
+ provided by gdbarch.
+ (CALL_DUMMY_P): Add FIXME. gdbarch should provide default.
+
+ * valprint.c (IEEE_FLOAT): Default provided by gdbarch.
+
2000-04-19 Jim Blandy <jimb@redhat.com>
Bring RETURN_VALUE_ON_STACK under gdbarch's control.
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 69e0d8c..1db4ce9 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -339,7 +339,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
/* Force the explicit initialization of these. */
gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
- gdbarch->ieee_float = 1;
gdbarch->num_regs = -1;
gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1;
@@ -663,11 +662,9 @@ gdbarch_dump (void)
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
(long) TARGET_LONG_DOUBLE_BIT);
-#ifdef IEEE_FLOAT
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: IEEE_FLOAT = %ld\n",
(long) IEEE_FLOAT);
-#endif
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
(long) current_gdbarch->read_pc
@@ -988,6 +985,8 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
int
gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
{
+ if (GDB_MULTI_ARCH == 0)
+ return TARGET_ARCHITECTURE->bits_per_address;
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
@@ -1634,6 +1633,8 @@ set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
LONGEST *
gdbarch_call_dummy_words (struct gdbarch *gdbarch)
{
+ if (GDB_MULTI_ARCH == 0)
+ return legacy_call_dummy_words;
/* Skip verify of call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
@@ -1650,6 +1651,8 @@ set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
int
gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
{
+ if (GDB_MULTI_ARCH == 0)
+ return legacy_sizeof_call_dummy_words;
/* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
@@ -3250,13 +3253,6 @@ set_gdbarch_from_file (abfd)
}
-#if defined (CALL_DUMMY)
-/* FIXME - this should go away */
-LONGEST call_dummy_words[] = CALL_DUMMY;
-int sizeof_call_dummy_words = sizeof (call_dummy_words);
-#endif
-
-
/* Initialize the current architecture. */
void
initialize_current_architecture ()
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 5c74e75..cdf60a7 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -89,11 +89,9 @@ extern int gdbarch_byte_order (struct gdbarch *gdbarch);
extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
-#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_BFD_VMA_BIT)
#define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
#endif
-#endif
extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
@@ -161,11 +159,9 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl
extern int gdbarch_ieee_float (struct gdbarch *gdbarch);
extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
-#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (IEEE_FLOAT)
#define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch))
#endif
-#endif
typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid);
extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid);
@@ -404,19 +400,15 @@ extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p)
extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
-#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_WORDS)
#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
#endif
-#endif
extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
-#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (SIZEOF_CALL_DUMMY_WORDS)
#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
#endif
-#endif
extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch);
extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 5cd4f88..ffa925e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -191,7 +191,7 @@ v:1:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):0
v:1:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0
v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):0
v:1:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):0
-v:1:IEEE_FLOAT:int:ieee_float::::0:1:0:::#
+v:1:IEEE_FLOAT:int:ieee_float::::0:0:0:::
#
f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0
f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
@@ -423,11 +423,17 @@ do
echo ""
echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);"
echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});"
- echo "#if GDB_MULTI_ARCH"
+ if ! default_is_fallback_p
+ then
+ echo "#if GDB_MULTI_ARCH"
+ fi
echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
echo "#define ${macro} (gdbarch_${function} (current_gdbarch))"
echo "#endif"
- echo "#endif"
+ if ! default_is_fallback_p
+ then
+ echo "#endif"
+ fi
;;
"f" )
echo ""
@@ -1134,6 +1140,11 @@ do
echo "${returntype}"
echo "gdbarch_${function} (struct gdbarch *gdbarch)"
echo "{"
+ if default_is_fallback_p && [ "${default}" != "0" ]
+ then
+ echo " if (GDB_MULTI_ARCH == 0)"
+ echo " return ${default};"
+ fi
if [ "${invalid_p}" = "0" ]
then
echo " /* Skip verify of ${function}, invalid_p == 0 */"
@@ -1940,13 +1951,6 @@ set_gdbarch_from_file (abfd)
}
-#if defined (CALL_DUMMY)
-/* FIXME - this should go away */
-LONGEST call_dummy_words[] = CALL_DUMMY;
-int sizeof_call_dummy_words = sizeof (call_dummy_words);
-#endif
-
-
/* Initialize the current architecture. */
void
initialize_current_architecture ()
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 66513b6..6ec78f5 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -426,6 +426,9 @@ extern int attach_flag;
#define CALL_DUMMY_STACK_ADJUST_P (0)
#endif
+/* FIXME: cagney/2000-04-17: gdbarch should manage this. The default
+ shouldn't be necessary. */
+
#if !defined (CALL_DUMMY_P)
#if defined (CALL_DUMMY)
#define CALL_DUMMY_P 1
@@ -434,24 +437,6 @@ extern int attach_flag;
#endif
#endif
-#if !defined (CALL_DUMMY_WORDS)
-#if defined (CALL_DUMMY)
-extern LONGEST call_dummy_words[];
-#define CALL_DUMMY_WORDS (call_dummy_words)
-#else
-#define CALL_DUMMY_WORDS (internal_error ("CALL_DUMMY_WORDS"), (void*) 0)
-#endif
-#endif
-
-#if !defined (SIZEOF_CALL_DUMMY_WORDS)
-#if defined (CALL_DUMMY)
-extern int sizeof_call_dummy_words;
-#define SIZEOF_CALL_DUMMY_WORDS (sizeof_call_dummy_words)
-#else
-#define SIZEOF_CALL_DUMMY_WORDS (internal_error ("SIZEOF_CALL_DUMMY_WORDS"), 0)
-#endif
-#endif
-
#if !defined PUSH_DUMMY_FRAME
#define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0)
#endif
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 455d7ee..a9162d8 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -562,12 +562,6 @@ longest_to_int (arg)
}
-/* Provide a default value for IEEE_FLOAT. */
-#ifndef IEEE_FLOAT
-#define IEEE_FLOAT (0)
-#endif
-
-
/* Print a floating point value of type TYPE, pointed to in GDB by VALADDR,
on STREAM. */