* 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.
This commit is contained in:
Andrew Cagney 2000-04-20 04:24:04 +00:00
parent 28ea9521fe
commit ba886e9d72
6 changed files with 36 additions and 52 deletions

View file

@ -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> 2000-04-19 Jim Blandy <jimb@redhat.com>
Bring RETURN_VALUE_ON_STACK under gdbarch's control. Bring RETURN_VALUE_ON_STACK under gdbarch's control.

View file

@ -339,7 +339,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
/* Force the explicit initialization of these. */ /* Force the explicit initialization of these. */
gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
gdbarch->ieee_float = 1;
gdbarch->num_regs = -1; gdbarch->num_regs = -1;
gdbarch->sp_regnum = -1; gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1; gdbarch->fp_regnum = -1;
@ -663,11 +662,9 @@ gdbarch_dump (void)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n", "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
(long) TARGET_LONG_DOUBLE_BIT); (long) TARGET_LONG_DOUBLE_BIT);
#ifdef IEEE_FLOAT
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: IEEE_FLOAT = %ld\n", "gdbarch_update: IEEE_FLOAT = %ld\n",
(long) IEEE_FLOAT); (long) IEEE_FLOAT);
#endif
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_READ_PC = 0x%08lx\n", "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
(long) current_gdbarch->read_pc (long) current_gdbarch->read_pc
@ -988,6 +985,8 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
int int
gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) 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 */ /* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
@ -1634,6 +1633,8 @@ set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
LONGEST * LONGEST *
gdbarch_call_dummy_words (struct gdbarch *gdbarch) 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 */ /* Skip verify of call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
@ -1650,6 +1651,8 @@ set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
int int
gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) 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 */ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); 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. */ /* Initialize the current architecture. */
void void
initialize_current_architecture () initialize_current_architecture ()

View file

@ -89,11 +89,9 @@ extern int gdbarch_byte_order (struct gdbarch *gdbarch);
extern int gdbarch_bfd_vma_bit (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); 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) #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_BFD_VMA_BIT)
#define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
#endif #endif
#endif
extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); 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 int gdbarch_ieee_float (struct gdbarch *gdbarch);
extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (IEEE_FLOAT) #if (GDB_MULTI_ARCH > 1) || !defined (IEEE_FLOAT)
#define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch)) #define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch))
#endif #endif
#endif
typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid); typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid);
extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, 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 LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); 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) #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_WORDS)
#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
#endif #endif
#endif
extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); 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); 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) #if (GDB_MULTI_ARCH > 1) || !defined (SIZEOF_CALL_DUMMY_WORDS)
#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
#endif #endif
#endif
extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); 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); extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p);

View file

@ -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_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0
v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):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: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_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 f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
@ -423,11 +423,17 @@ do
echo "" echo ""
echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);"
echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});" 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 "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" echo "#define ${macro} (gdbarch_${function} (current_gdbarch))"
echo "#endif" echo "#endif"
echo "#endif" if ! default_is_fallback_p
then
echo "#endif"
fi
;; ;;
"f" ) "f" )
echo "" echo ""
@ -1134,6 +1140,11 @@ do
echo "${returntype}" echo "${returntype}"
echo "gdbarch_${function} (struct gdbarch *gdbarch)" echo "gdbarch_${function} (struct gdbarch *gdbarch)"
echo "{" echo "{"
if default_is_fallback_p && [ "${default}" != "0" ]
then
echo " if (GDB_MULTI_ARCH == 0)"
echo " return ${default};"
fi
if [ "${invalid_p}" = "0" ] if [ "${invalid_p}" = "0" ]
then then
echo " /* Skip verify of ${function}, invalid_p == 0 */" 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. */ /* Initialize the current architecture. */
void void
initialize_current_architecture () initialize_current_architecture ()

View file

@ -426,6 +426,9 @@ extern int attach_flag;
#define CALL_DUMMY_STACK_ADJUST_P (0) #define CALL_DUMMY_STACK_ADJUST_P (0)
#endif #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_P)
#if defined (CALL_DUMMY) #if defined (CALL_DUMMY)
#define CALL_DUMMY_P 1 #define CALL_DUMMY_P 1
@ -434,24 +437,6 @@ extern int attach_flag;
#endif #endif
#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 #if !defined PUSH_DUMMY_FRAME
#define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0) #define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0)
#endif #endif

View file

@ -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, /* Print a floating point value of type TYPE, pointed to in GDB by VALADDR,
on STREAM. */ on STREAM. */