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.
+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.
/* 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;
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
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");
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");
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");
}
-#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 ()
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);
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);
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);
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
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 ""
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 */"
}
-#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 ()
#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
#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
}
-/* 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. */