diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-03-30 14:59:02 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-03-30 14:59:02 +0000 |
commit | 6c0e89edf99f71dcd9a8979e99388c9286e49edd (patch) | |
tree | 2368f97b2bd842c204d40bbd77aaec0b404c4277 | |
parent | f7dd6af2b559a621e7e36ba3eaadfb6a11006cdf (diff) | |
download | gdb-6c0e89edf99f71dcd9a8979e99388c9286e49edd.zip gdb-6c0e89edf99f71dcd9a8979e99388c9286e49edd.tar.gz gdb-6c0e89edf99f71dcd9a8979e99388c9286e49edd.tar.bz2 |
2003-03-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (DEPRECATED_DUMMY_WRITE_SP): Replace TARGET_WRITE_SP.
* gdbarch.h, gdbarch.c: Regenerate.
* v850-tdep.c (v850_gdbarch_init): Set deprecated_dummy_write_sp.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto.
* mcore-tdep.c (mcore_gdbarch_init): Ditto.
* m68k-tdep.c (m68k_gdbarch_init): Ditto.
* i386-tdep.c (i386_gdbarch_init): Ditto.
* h8300-tdep.c (h8300_gdbarch_init): Ditto.
* cris-tdep.c (cris_gdbarch_init): Ditto.
* vax-tdep.c (vax_gdbarch_init): Ditto.
* s390-tdep.c (s390_gdbarch_init): Ditto.
* ns32k-tdep.c (ns32k_gdbarch_init): Ditto.
* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
* alpha-tdep.c (alpha_gdbarch_init): Ditto.
* sparc-tdep.c (sparc_push_dummy_frame, sparc_pop_frame): Update.
* config/sparc/tm-sp64.h (DEPRECATED_DUMMY_WRITE_SP): Update.
* config/pa/tm-hppa.h (DEPRECATED_DUMMY_WRITE_SP): Define.
* sparc-tdep.c (sparc_gdbarch_init): Update.
* sh-tdep.c (sh_gdbarch_init): Update.
* rs6000-tdep.c (rs6000_gdbarch_init): Update.
* mips-tdep.c (mips_gdbarch_init): Update.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
* ia64-tdep.c (ia64_gdbarch_init): Update.
* frv-tdep.c (frv_gdbarch_init): Update.
* avr-tdep.c (avr_gdbarch_init): Update.
* valops.c (hand_function_call): Replace TARGET_WRITE_SP with
DEPRECATED_DUMMY_WRITE_SP. Call when the method is available,
instead of when push_dummy_call is not available.
2003-03-30 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Remove
reference to TARGET_WRITE_SP.
-rw-r--r-- | gdb/ChangeLog | 31 | ||||
-rw-r--r-- | gdb/alpha-tdep.c | 2 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 1 | ||||
-rw-r--r-- | gdb/avr-tdep.c | 2 | ||||
-rw-r--r-- | gdb/config/pa/tm-hppa.h | 3 | ||||
-rw-r--r-- | gdb/config/sparc/tm-sp64.h | 2 | ||||
-rw-r--r-- | gdb/cris-tdep.c | 3 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/doc/gdbint.texinfo | 8 | ||||
-rw-r--r-- | gdb/frv-tdep.c | 2 | ||||
-rw-r--r-- | gdb/gdbarch.c | 65 | ||||
-rw-r--r-- | gdb/gdbarch.h | 40 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 3 | ||||
-rw-r--r-- | gdb/h8300-tdep.c | 3 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 3 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 2 | ||||
-rw-r--r-- | gdb/m68hc11-tdep.c | 2 | ||||
-rw-r--r-- | gdb/m68k-tdep.c | 3 | ||||
-rw-r--r-- | gdb/mcore-tdep.c | 3 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 2 | ||||
-rw-r--r-- | gdb/mn10300-tdep.c | 3 | ||||
-rw-r--r-- | gdb/ns32k-tdep.c | 3 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 2 | ||||
-rw-r--r-- | gdb/s390-tdep.c | 3 | ||||
-rw-r--r-- | gdb/sh-tdep.c | 2 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 8 | ||||
-rw-r--r-- | gdb/v850-tdep.c | 3 | ||||
-rw-r--r-- | gdb/valops.c | 4 | ||||
-rw-r--r-- | gdb/vax-tdep.c | 3 | ||||
-rw-r--r-- | gdb/xstormy16-tdep.c | 3 |
30 files changed, 164 insertions, 57 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 66efad6..55eb03d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,36 @@ 2003-03-30 Andrew Cagney <cagney@redhat.com> + * gdbarch.sh (DEPRECATED_DUMMY_WRITE_SP): Replace TARGET_WRITE_SP. + * gdbarch.h, gdbarch.c: Regenerate. + * v850-tdep.c (v850_gdbarch_init): Set deprecated_dummy_write_sp. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68k-tdep.c (m68k_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * vax-tdep.c (vax_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_push_dummy_frame, sparc_pop_frame): Update. + * config/sparc/tm-sp64.h (DEPRECATED_DUMMY_WRITE_SP): Update. + * config/pa/tm-hppa.h (DEPRECATED_DUMMY_WRITE_SP): Define. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * valops.c (hand_function_call): Replace TARGET_WRITE_SP with + DEPRECATED_DUMMY_WRITE_SP. Call when the method is available, + instead of when push_dummy_call is not available. + +2003-03-30 Andrew Cagney <cagney@redhat.com> + * infttrace.c: Include "gdbthread.h". (parent_attach_all): Fix function signature. (call_ptrace): Update call. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index d12c69f..1a19257 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -1875,6 +1875,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 5cf33cf..ca15251 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2943,7 +2943,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); - set_gdbarch_deprecated_push_return_address (gdbarch, arm_push_return_address); set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call); diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 4ed090d..d3da3aa 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1147,7 +1147,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, avr_write_pc); set_gdbarch_read_fp (gdbarch, avr_read_fp); set_gdbarch_read_sp (gdbarch, avr_read_sp); - set_gdbarch_write_sp (gdbarch, avr_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, avr_write_sp); set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS); diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 33ef7a1..9c26c79 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -24,6 +24,9 @@ #include "regcache.h" +/* Wonder if this is correct? Should be using push_dummy_call(). */ +#define DEPRECATED_DUMMY_WRITE_SP(SP) generic_target_write_sp (SP) + #define GDB_MULTI_ARCH 0 /* NOTE: cagney/2002-11-24: This is a guess. */ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 0e0e404..b4417b8 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -274,7 +274,7 @@ extern void sparc64_write_sp (CORE_ADDR); #define TARGET_READ_SP() (sparc64_read_sp ()) #define TARGET_READ_FP() (sparc64_read_fp ()) -#define TARGET_WRITE_SP(X) (sparc64_write_sp (X)) +#define DEPRECATED_DUMMY_WRITE_SP(X) (sparc64_write_sp (X)) #undef DEPRECATED_EXTRACT_RETURN_VALUE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index d79edf1..a618f55 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -4323,6 +4323,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Helpful for backtracing and returning in a call dummy. */ set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Use target_specific function to define link map offsets. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, cris_linux_svr4_fetch_link_map_offsets); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 1cc2b36..4286726 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,8 +1,13 @@ +2003-03-30 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Remove + reference to TARGET_WRITE_SP. + 2003-03-27 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Remove references to write_sp. - + 2003-03-27 Andrew Cagney <cagney@redhat.com> * gdb.texinfo (GDB/MI Variable Objects): Replace @include with diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 46bbe08..0530f81 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3777,10 +3777,8 @@ that is at the start of the real function. @item SP_REGNUM @findex SP_REGNUM If the stack-pointer is kept in a register, then define this macro to be -the number (greater than or equal to zero) of that register. - -This should only need to be defined if @code{TARGET_WRITE_SP} and -@code{TARGET_WRITE_SP} are not defined. +the number (greater than or equal to zero) of that register, or -1 if +there is no such register. @item STAB_REG_TO_REGNUM @findex STAB_REG_TO_REGNUM @@ -3887,8 +3885,6 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}. @findex TARGET_WRITE_PC @itemx TARGET_READ_SP @findex TARGET_READ_SP -@itemx TARGET_WRITE_SP -@findex TARGET_WRITE_SP @itemx TARGET_READ_FP @findex TARGET_READ_FP @findex read_pc diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 6be803a..2711b52 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1106,7 +1106,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1f40cca..4d94614 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -148,7 +148,7 @@ struct gdbarch gdbarch_write_pc_ftype *write_pc; gdbarch_read_fp_ftype *read_fp; gdbarch_read_sp_ftype *read_sp; - gdbarch_write_sp_ftype *write_sp; + gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp; gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; gdbarch_pseudo_register_read_ftype *pseudo_register_read; gdbarch_pseudo_register_write_ftype *pseudo_register_write; @@ -504,7 +504,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->write_pc = generic_target_write_pc; current_gdbarch->read_fp = generic_target_read_fp; current_gdbarch->read_sp = generic_target_read_sp; - current_gdbarch->write_sp = generic_target_write_sp; current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; current_gdbarch->num_regs = -1; current_gdbarch->sp_regnum = -1; @@ -632,7 +631,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of write_pc, invalid_p == 0 */ /* Skip verify of read_fp, invalid_p == 0 */ /* Skip verify of read_sp, invalid_p == 0 */ - /* Skip verify of write_sp, invalid_p == 0 */ + /* Skip verify of deprecated_dummy_write_sp, has predicate */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate */ /* Skip verify of pseudo_register_write, has predicate */ @@ -1127,6 +1126,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_do_registers_info /*DEPRECATED_DO_REGISTERS_INFO ()*/); #endif +#ifdef DEPRECATED_DUMMY_WRITE_SP_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_DUMMY_WRITE_SP_P()", + XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n", + DEPRECATED_DUMMY_WRITE_SP_P ()); +#endif +#ifdef DEPRECATED_DUMMY_WRITE_SP +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_DUMMY_WRITE_SP(val)", + XSTRING (DEPRECATED_DUMMY_WRITE_SP (val))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n", + (long) current_gdbarch->deprecated_dummy_write_sp + /*DEPRECATED_DUMMY_WRITE_SP ()*/); +#endif #ifdef DEPRECATED_EXTRACT_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -2576,20 +2598,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->write_pc /*TARGET_WRITE_PC ()*/); #endif -#ifdef TARGET_WRITE_SP -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "TARGET_WRITE_SP(val)", - XSTRING (TARGET_WRITE_SP (val))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_WRITE_SP = <0x%08lx>\n", - (long) current_gdbarch->write_sp - /*TARGET_WRITE_SP ()*/); -#endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n", @@ -2938,23 +2946,30 @@ set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch->read_sp = read_sp; } +int +gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_dummy_write_sp != 0; +} + void -gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) +gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) { gdb_assert (gdbarch != NULL); - if (gdbarch->write_sp == 0) + if (gdbarch->deprecated_dummy_write_sp == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_write_sp invalid"); + "gdbarch: gdbarch_deprecated_dummy_write_sp invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); - gdbarch->write_sp (val); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n"); + gdbarch->deprecated_dummy_write_sp (val); } void -set_gdbarch_write_sp (struct gdbarch *gdbarch, - gdbarch_write_sp_ftype write_sp) +set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, + gdbarch_deprecated_dummy_write_sp_ftype deprecated_dummy_write_sp) { - gdbarch->write_sp = write_sp; + gdbarch->deprecated_dummy_write_sp = deprecated_dummy_write_sp; } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 94926fd..de8cb2d 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -388,20 +388,42 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype #endif #endif +/* The dummy call frame SP should be set by push_dummy_call. */ + +#if defined (DEPRECATED_DUMMY_WRITE_SP) +/* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */ +#if !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (0) +#endif + +extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP) -#define TARGET_WRITE_SP(val) (generic_target_write_sp (val)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0) #endif -typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val); -extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); -extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP) -#error "Non multi-arch definition of TARGET_WRITE_SP" +typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val); +extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); +extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP) -#define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val)) #endif #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index bb9d90c..91f2293 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -430,7 +430,8 @@ f:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc: f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0 f:2:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0 f:2:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0 -f:2:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0 +# The dummy call frame SP should be set by push_dummy_call. +F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val # Function for getting target's idea of a frame pointer. FIXME: GDB's # whole scheme for dealing with "frames" and "frame pointers" needs a # serious shakedown. diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 3ade064..e08cff7 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1175,6 +1175,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */ set_gdbarch_believe_pcc_promotion (gdbarch, 1); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index a797e7b..ede206f 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1630,6 +1630,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 75f77f7..5ace962 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -2237,7 +2237,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 04d82df..3fff897 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1369,7 +1369,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM); set_gdbarch_fp_regnum (gdbarch, SOFT_FP_REGNUM); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index a72ea53..c25f2e1 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1051,6 +1051,9 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 1715bab..a112eee 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -1163,6 +1163,9 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) between registers and stack. */ set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index fcf3ad3..67f516b 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -6003,7 +6003,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */ set_gdbarch_read_sp (gdbarch, mips_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); /* Add/remove bits from an address. The MIPS needs be careful to ensure that all 32 bit addresses are sign extended to 64 bits. */ diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 4e11652..156adbf 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1204,6 +1204,9 @@ mn10300_gdbarch_init (struct gdbarch_info info, tdep->am33_mode = am33_mode; + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index fbf0417..4e43674 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -612,6 +612,9 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Misc info */ set_gdbarch_function_start_offset (gdbarch, 0); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 420d830..6dea3d8 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2876,7 +2876,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_num_regs (gdbarch, v->nregs); set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index f7233bc..6574874 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1907,6 +1907,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 9319335..38098b5 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -4641,7 +4641,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_register_name (gdbarch, sh_register_name); set_gdbarch_register_virtual_type (gdbarch, sh_register_virtual_type); diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index e4f2457..a6ca7cd 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1040,7 +1040,7 @@ sparc_push_dummy_frame (void) sp -= DUMMY_STACK_SIZE; - TARGET_WRITE_SP (sp); + DEPRECATED_DUMMY_WRITE_SP (sp); write_memory (sp + DUMMY_REG_SAVE_OFFSET, ®ister_temp[0], DUMMY_STACK_REG_BUF_SIZE); @@ -1310,7 +1310,7 @@ sparc_pop_frame (void) read_memory_integer (fsr[O0_REGNUM + 7], SPARC_INTREG_SIZE)); - TARGET_WRITE_SP (get_frame_base (frame)); + DEPRECATED_DUMMY_WRITE_SP (get_frame_base (frame)); } else if (fsr[I0_REGNUM]) { @@ -3279,7 +3279,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); tdep->y_regnum = SPARC32_Y_REGNUM; tdep->fp_max_regnum = SPARC_FP0_REGNUM + 32; tdep->intreg_size = 4; @@ -3337,7 +3337,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, sparc64_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, sparc64_use_struct_convention); - set_gdbarch_write_sp (gdbarch, sparc64_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, sparc64_write_sp); tdep->y_regnum = SPARC64_Y_REGNUM; tdep->fp_max_regnum = SPARC_FP0_REGNUM + 48; tdep->intreg_size = 8; diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 986c9f1..e6720a4 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1292,6 +1292,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/valops.c b/gdb/valops.c index 6cbaa4f..5b36cb7 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1696,8 +1696,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name); stored the stack pointer (as part of creating the fake call frame), and none of the code following that code adjusts the stack-pointer value, the below call is entirely redundant. */ - if (!gdbarch_push_dummy_call_p (current_gdbarch)) - TARGET_WRITE_SP (sp); + if (DEPRECATED_DUMMY_WRITE_SP_P ()) + DEPRECATED_DUMMY_WRITE_SP (sp); if (SAVE_DUMMY_FRAME_TOS_P ()) SAVE_DUMMY_FRAME_TOS (sp); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index d2ac421..aac62f3 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -686,6 +686,9 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 2); set_gdbarch_believe_pcc_promotion (gdbarch, 1); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index a228391..1ddc03f 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1122,6 +1122,9 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_in_solib_call_trampoline (gdbarch, xstormy16_in_solib_call_trampoline); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } |