Patchwork [PATCHv3,4/4] gdb: Supply default gdbarch_unwind_sp and use where possible

login
register
mail settings
Submitter Andrew Burgess
Date June 5, 2018, 2:34 p.m.
Message ID <83b9ed0f0e6fcddbed3b2e717ef6924edc6ced39.1528206468.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/27629/
State New
Headers show

Comments

Andrew Burgess - June 5, 2018, 2:34 p.m.
Most unwind_sp methods follow the same pattern.  This commit provides
a default implementation of gdbarch_unwind_sp and switches targets
over to this method where possible.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_unwind_sp): Delete.
	(aarch64_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* arm-tdep.c (arm_unwind_sp): Delete.
	(arm_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* cris-tdep.c (cris_unwind_sp): Delete.
	(cris_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* frame-unwind.c (default_unwind_sp): Define new function.
	* frame-unwind.h (default_unwind_sp): Declare new function.
	* frame.c (get_frame_sp): Assume gdbarch_unwind_sp is always
	available.
	* frv-tdep.c (frv_unwind_sp): Delete.
	(frv_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* ft32-tdep.c (ft32_unwind_sp): Delete.
	(ft32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh: Update 'unwind_sp', remove predicate, and supply a
	default method name.
	* h8300-tdep.c (h8300_unwind_sp): Delete.
	(h8300_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* iq2000-tdep.c (iq2000_unwind_sp): Delete.
	(iq2000_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* lm32-tdep.c (lm32_unwind_sp): Delete.
	(lm32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* m32r-tdep.c (m32r_unwind_sp): Delete.
	(m32r_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* m68hc11-tdep.c (m68hc11_unwind_sp): Delete.
	(m68hc11_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* mep-tdep.c (mep_unwind_sp): Delete.
	(mep_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* mn10300-tdep.c (mn10300_unwind_sp): Delete.
	(mn10300_frame_unwind_init): Don't call set_gdbarch_unwind_sp.
	(mn10300_push_dummy_call): Call gdbarch_unwind_sp instead.
	* moxie-tdep.c (moxie_unwind_sp): Delete.
	(moxie_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* msp430-tdep.c (msp430_unwind_sp): Delete.
	(msp430_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* nds32-tdep.c (nds32_unwind_sp): Delete.
	(nds32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* nios2-tdep.c (nios2_unwind_sp): Delete.
	(nios2_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* riscv-tdep.c (riscv_unwind_sp): Delete.
	(riscv_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* rl78-tdep.c (rl78_unwind_sp): Delete.
	(rl78_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* rx-tdep.c (rx_unwind_sp): Delete.
	(rx_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* score-tdep.c (score_unwind_sp): Delete.
	(score_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* sh-tdep.c (sh_unwind_sp): Delete.
	(sh_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* tic6x-tdep.c (tic6x_unwind_sp): Delete.
	(tic6x_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* tilegx-tdep.c (tilegx_unwind_sp): Delete.
	(tilegx_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* v850-tdep.c (v850_unwind_sp): Delete.
	(v850_gdbarch_init): Don't call set_gdbarch_unwind_sp.
	* xstormy16-tdep.c (xstormy16_unwind_sp): Delete.
	(xstormy16_gdbarch_init): Don't call set_gdbarch_unwind_sp.
---
 gdb/ChangeLog        | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/aarch64-tdep.c   | 11 ----------
 gdb/arm-tdep.c       |  9 --------
 gdb/cris-tdep.c      | 14 ------------
 gdb/frame-unwind.c   | 11 ++++++++++
 gdb/frame-unwind.h   |  6 +++++
 gdb/frame.c          | 15 +++----------
 gdb/frv-tdep.c       |  7 ------
 gdb/ft32-tdep.c      | 10 ---------
 gdb/gdbarch.c        | 13 ++---------
 gdb/gdbarch.h        |  2 --
 gdb/gdbarch.sh       |  2 +-
 gdb/h8300-tdep.c     |  7 ------
 gdb/iq2000-tdep.c    |  7 ------
 gdb/lm32-tdep.c      |  7 ------
 gdb/m32r-tdep.c      |  9 --------
 gdb/m68hc11-tdep.c   | 10 ---------
 gdb/mep-tdep.c       | 11 ----------
 gdb/mn10300-tdep.c   | 12 +---------
 gdb/moxie-tdep.c     | 10 ---------
 gdb/msp430-tdep.c    |  9 --------
 gdb/nds32-tdep.c     |  9 --------
 gdb/nios2-tdep.c     | 10 ---------
 gdb/riscv-tdep.c     | 11 ----------
 gdb/rl78-tdep.c      |  9 --------
 gdb/rx-tdep.c        | 12 ----------
 gdb/score-tdep.c     |  7 ------
 gdb/sh-tdep.c        |  8 -------
 gdb/tic6x-tdep.c     | 11 ----------
 gdb/tilegx-tdep.c    |  7 ------
 gdb/v850-tdep.c      |  8 -------
 gdb/xstormy16-tdep.c |  7 ------
 32 files changed, 86 insertions(+), 257 deletions(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c2f6957b461..57c2f0507cb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,65 @@ 
+2018-06-05  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* aarch64-tdep.c (aarch64_unwind_sp): Delete.
+	(aarch64_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* arm-tdep.c (arm_unwind_sp): Delete.
+	(arm_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* cris-tdep.c (cris_unwind_sp): Delete.
+	(cris_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* frame-unwind.c (default_unwind_sp): Define new function.
+	* frame-unwind.h (default_unwind_sp): Declare new function.
+	* frame.c (get_frame_sp): Assume gdbarch_unwind_sp is always
+	available.
+	* frv-tdep.c (frv_unwind_sp): Delete.
+	(frv_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* ft32-tdep.c (ft32_unwind_sp): Delete.
+	(ft32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* gdbarch.c: Regenerate.
+	* gdbarch.h: Regenerate.
+	* gdbarch.sh: Update 'unwind_sp', remove predicate, and supply a
+	default method name.
+	* h8300-tdep.c (h8300_unwind_sp): Delete.
+	(h8300_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* iq2000-tdep.c (iq2000_unwind_sp): Delete.
+	(iq2000_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* lm32-tdep.c (lm32_unwind_sp): Delete.
+	(lm32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* m32r-tdep.c (m32r_unwind_sp): Delete.
+	(m32r_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* m68hc11-tdep.c (m68hc11_unwind_sp): Delete.
+	(m68hc11_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* mep-tdep.c (mep_unwind_sp): Delete.
+	(mep_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* mn10300-tdep.c (mn10300_unwind_sp): Delete.
+	(mn10300_frame_unwind_init): Don't call set_gdbarch_unwind_sp.
+	(mn10300_push_dummy_call): Call gdbarch_unwind_sp instead.
+	* moxie-tdep.c (moxie_unwind_sp): Delete.
+	(moxie_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* msp430-tdep.c (msp430_unwind_sp): Delete.
+	(msp430_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* nds32-tdep.c (nds32_unwind_sp): Delete.
+	(nds32_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* nios2-tdep.c (nios2_unwind_sp): Delete.
+	(nios2_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* riscv-tdep.c (riscv_unwind_sp): Delete.
+	(riscv_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* rl78-tdep.c (rl78_unwind_sp): Delete.
+	(rl78_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* rx-tdep.c (rx_unwind_sp): Delete.
+	(rx_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* score-tdep.c (score_unwind_sp): Delete.
+	(score_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* sh-tdep.c (sh_unwind_sp): Delete.
+	(sh_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* tic6x-tdep.c (tic6x_unwind_sp): Delete.
+	(tic6x_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* tilegx-tdep.c (tilegx_unwind_sp): Delete.
+	(tilegx_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* v850-tdep.c (v850_unwind_sp): Delete.
+	(v850_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+	* xstormy16-tdep.c (xstormy16_unwind_sp): Delete.
+	(xstormy16_gdbarch_init): Don't call set_gdbarch_unwind_sp.
+
 2018-06-05  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* aarch64-tdep.c (aarch64_dummy_id): Delete.
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 71f5066e996..54234f24505 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1000,14 +1000,6 @@  struct frame_base aarch64_normal_base =
   aarch64_normal_frame_base
 };
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-aarch64_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_unwind_register_unsigned (this_frame, AARCH64_SP_REGNUM);
-}
-
 /* Return the value of the REGNUM register in the previous frame of
    *THIS_FRAME.  */
 
@@ -2925,9 +2917,6 @@  aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_dummy_call (gdbarch, aarch64_push_dummy_call);
   set_gdbarch_frame_align (gdbarch, aarch64_frame_align);
 
-  /* Frame handling.  */
-  set_gdbarch_unwind_sp (gdbarch, aarch64_unwind_sp);
-
   /* Advance PC across function entry code.  */
   set_gdbarch_skip_prologue (gdbarch, aarch64_skip_prologue);
 
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 933cd136941..e37ddb94e43 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3055,12 +3055,6 @@  struct frame_base arm_normal_base = {
   arm_normal_frame_base
 };
 
-static CORE_ADDR
-arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM);
-}
-
 static struct value *
 arm_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
 			  int regnum)
@@ -9332,9 +9326,6 @@  arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_write_pc (gdbarch, arm_write_pc);
 
-  /* Frame handling.  */
-  set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp);
-
   frame_base_set_default (gdbarch, &arm_normal_base);
 
   /* Address manipulation.  */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index a731a673c3f..ab04921b1b4 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -651,9 +651,6 @@  static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,
 					struct frame_info *this_frame,
 					struct cris_unwind_cache *info);
 
-static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, 
-				 struct frame_info *next_frame);
-
 /* When arguments must be pushed onto the stack, they go on in reverse
    order.  The below implements a FILO (stack) to do this.
    Copied from d10v-tdep.c.  */
@@ -1358,15 +1355,6 @@  cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   return pc_after_prologue;
 }
 
-static CORE_ADDR
-cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  ULONGEST sp;
-  sp = frame_unwind_register_unsigned (next_frame,
-				       gdbarch_sp_regnum (gdbarch));
-  return sp;
-}
-
 /* Implement the breakpoint_kind_from_pc gdbarch method.  */
 
 static int
@@ -4072,8 +4060,6 @@  cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind);
   
-  set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);
-
   if (tdep->cris_dwarf2_cfi == 1)
     {
       /* Hook in the Dwarf-2 frame sniffer.  */
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index d5b20e4af73..df2e5ddc6bd 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -213,6 +213,17 @@  default_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
   return addr;
 }
 
+/* Default unwind of the SP.  */
+
+CORE_ADDR
+default_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+  int sp_regnum;
+
+  sp_regnum = gdbarch_sp_regnum (gdbarch);
+  return frame_unwind_register_unsigned (next_frame, sp_regnum);
+}
+
 /* Helper functions for value-based register unwinding.  These return
    a (possibly lazy) value of the appropriate type.  */
 
diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h
index 4dfc7bedcc6..3ca3fdfe727 100644
--- a/gdb/frame-unwind.h
+++ b/gdb/frame-unwind.h
@@ -76,6 +76,12 @@  enum unwind_stop_reason
 extern CORE_ADDR default_unwind_pc (struct gdbarch *gdbarch,
 				    struct frame_info *next_frame);
 
+/* A default unwind_sp callback that simply unwinds the register identified
+   by GDBARCH_SP_REGNUM.  */
+
+extern CORE_ADDR default_unwind_sp (struct gdbarch *gdbarch,
+				    struct frame_info *next_frame);
+
 /* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
    use THIS frame, and through it the NEXT frame's register unwind
    method, to determine the frame ID of THIS frame.
diff --git a/gdb/frame.c b/gdb/frame.c
index 7796cd265d3..3e5001d187b 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2776,18 +2776,9 @@  get_frame_sp (struct frame_info *this_frame)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
 
-  /* Normality - an architecture that provides a way of obtaining any
-     frame inner-most address.  */
-  if (gdbarch_unwind_sp_p (gdbarch))
-    /* NOTE drow/2008-06-28: gdbarch_unwind_sp could be converted to
-       operate on THIS_FRAME now.  */
-    return gdbarch_unwind_sp (gdbarch, this_frame->next);
-  /* Now things are really are grim.  Hope that the value returned by
-     the gdbarch_sp_regnum register is meaningful.  */
-  if (gdbarch_sp_regnum (gdbarch) >= 0)
-    return get_frame_register_unsigned (this_frame,
-					gdbarch_sp_regnum (gdbarch));
-  internal_error (__FILE__, __LINE__, _("Missing unwind SP method"));
+  /* NOTE drow/2008-06-28: gdbarch_unwind_sp could be converted to
+     operate on THIS_FRAME now.  */
+  return gdbarch_unwind_sp (gdbarch, this_frame->next);
 }
 
 /* Return the reason why we can't unwind past FRAME.  */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index c967d2a6d16..33ab6137bdf 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1432,12 +1432,6 @@  static const struct frame_base frv_frame_base = {
   frv_frame_base_address
 };
 
-static CORE_ADDR
-frv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, sp_regnum);
-}
-
 static struct gdbarch *
 frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
@@ -1521,7 +1515,6 @@  frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_return_value (gdbarch, frv_return_value);
 
   /* Frame stuff.  */
-  set_gdbarch_unwind_sp (gdbarch, frv_unwind_sp);
   set_gdbarch_frame_align (gdbarch, frv_frame_align);
   frame_base_set_default (gdbarch, &frv_frame_base);
   /* We set the sniffer lower down after the OSABI hooks have been
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index 79cf1a08c1d..17f1ceb7a9b 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -383,14 +383,6 @@  ft32_address_class_name_to_type_flags (struct gdbarch *gdbarch,
     return 0;
 }
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-ft32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, FT32_SP_REGNUM);
-}
-
 /* Given a return value in `regbuf' with a type `valtype',
    extract and copy its value into `valbuf'.  */
 
@@ -586,8 +578,6 @@  ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 				     func_void_type);
   TYPE_INSTANCE_FLAGS (tdep->pc_type) |= TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
 
-  set_gdbarch_unwind_sp (gdbarch, ft32_unwind_sp);
-
   set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS);
   set_gdbarch_sp_regnum (gdbarch, FT32_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, FT32_PC_REGNUM);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1ba256f921a..41e596630ec 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -430,6 +430,7 @@  gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
   gdbarch->remote_register_number = default_remote_register_number;
   gdbarch->unwind_pc = default_unwind_pc;
+  gdbarch->unwind_sp = default_unwind_sp;
   gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
   gdbarch->addr_bits_remove = core_addr_identity;
@@ -613,7 +614,7 @@  verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of fetch_tls_load_module_address, has predicate.  */
   /* Skip verify of frame_args_skip, invalid_p == 0 */
   /* Skip verify of unwind_pc, invalid_p == 0 */
-  /* Skip verify of unwind_sp, has predicate.  */
+  /* Skip verify of unwind_sp, invalid_p == 0 */
   /* Skip verify of frame_num_args, has predicate.  */
   /* Skip verify of frame_align, has predicate.  */
   /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
@@ -1439,9 +1440,6 @@  gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: unwind_pc = <%s>\n",
                       host_address_to_string (gdbarch->unwind_pc));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
-                      gdbarch_unwind_sp_p (gdbarch));
   fprintf_unfiltered (file,
                       "gdbarch_dump: unwind_sp = <%s>\n",
                       host_address_to_string (gdbarch->unwind_sp));
@@ -3049,13 +3047,6 @@  set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
   gdbarch->unwind_pc = unwind_pc;
 }
 
-int
-gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->unwind_sp != NULL;
-}
-
 CORE_ADDR
 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 4d994a17b50..1c9478efee8 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -622,8 +622,6 @@  typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct fra
 extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
 extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
 
-extern int gdbarch_unwind_sp_p (struct gdbarch *gdbarch);
-
 typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
 extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame);
 extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 6db8b0eb50a..02b519043bb 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -597,7 +597,7 @@  F;CORE_ADDR;fetch_tls_load_module_address;struct objfile *objfile;objfile
 #
 v;CORE_ADDR;frame_args_skip;;;0;;;0
 m;CORE_ADDR;unwind_pc;struct frame_info *next_frame;next_frame;;default_unwind_pc;;0
-M;CORE_ADDR;unwind_sp;struct frame_info *next_frame;next_frame
+m;CORE_ADDR;unwind_sp;struct frame_info *next_frame;next_frame;;default_unwind_sp;;0
 # DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
 # frame-base.  Enable frame-base before frame-unwind.
 F;int;frame_num_args;struct frame_info *frame;frame
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index fa2597f9d0d..f043704591c 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -92,12 +92,6 @@  static int is_h8300_normal_mode (struct gdbarch *gdbarch);
 		  && !is_h8300_normal_mode (gdbarch)) \
 		 ? h8300h_reg_size : h8300_reg_size)
 
-static CORE_ADDR
-h8300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-}
-
 /* Normal frames.  */
 
 /* Allocate and initialize a frame cache.  */
@@ -1340,7 +1334,6 @@  h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue);
 
   /* Frame unwinder.  */
-  set_gdbarch_unwind_sp (gdbarch, h8300_unwind_sp);
   frame_base_set_default (gdbarch, &h8300_frame_base);
 
   /* 
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index f98b9066858..5dbc18bb67e 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -434,12 +434,6 @@  static const struct frame_unwind iq2000_frame_unwind = {
   default_frame_sniffer
 };
 
-static CORE_ADDR
-iq2000_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-}   
-
 static CORE_ADDR
 iq2000_frame_base_address (struct frame_info *this_frame, void **this_cache)
 {
@@ -827,7 +821,6 @@  iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than           (gdbarch, core_addr_lessthan);
   set_gdbarch_register_type (gdbarch, iq2000_register_type);
   set_gdbarch_frame_align (gdbarch, iq2000_frame_align);
-  set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp);
   frame_base_set_default (gdbarch, &iq2000_frame_base);
   set_gdbarch_push_dummy_call (gdbarch, iq2000_push_dummy_call);
 
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 651b09c73ec..5cf15625304 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -382,12 +382,6 @@  lm32_return_value (struct gdbarch *gdbarch, struct value *function,
   return RETURN_VALUE_REGISTER_CONVENTION;
 }
 
-static CORE_ADDR
-lm32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, SIM_LM32_SP_REGNUM);
-}
-
 /* Put here the code to store, into fi->saved_regs, the addresses of
    the saved registers of frame described by FRAME_INFO.  This
    includes special registers such as pc and fp saved in special ways
@@ -537,7 +531,6 @@  lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Frame unwinding.  */
   set_gdbarch_frame_align (gdbarch, lm32_frame_align);
   frame_base_set_default (gdbarch, &lm32_frame_base);
-  set_gdbarch_unwind_sp (gdbarch, lm32_unwind_sp);
   frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind);
 
   /* Breakpoints.  */
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 77019162d22..4b2ab6d01bf 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -649,13 +649,6 @@  m32r_frame_unwind_cache (struct frame_info *this_frame,
   return info;
 }
 
-static CORE_ADDR
-m32r_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, M32R_SP_REGNUM);
-}
-
-
 static CORE_ADDR
 m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
@@ -884,8 +877,6 @@  m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_wchar_bit (gdbarch, 16);
   set_gdbarch_wchar_signed (gdbarch, 0);
 
-  set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp);
-
   set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS);
   set_gdbarch_pc_regnum (gdbarch, M32R_PC_REGNUM);
   set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 52dc118e622..52320fbebb4 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -967,14 +967,6 @@  static const struct frame_base m68hc11_frame_base = {
   m68hc11_frame_args_address
 };
 
-static CORE_ADDR
-m68hc11_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  ULONGEST sp;
-  sp = frame_unwind_register_unsigned (next_frame, HARD_SP_REGNUM);
-  return sp;
-}
-
 /* Assuming THIS_FRAME is a dummy, return the frame ID of that dummy
    frame.  The frame ID's base needs to match the TOS value saved by
    save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint.  */
@@ -1481,8 +1473,6 @@  m68hc11_gdbarch_init (struct gdbarch_info info,
   /* Characters are unsigned.  */
   set_gdbarch_char_signed (gdbarch, 0);
 
-  set_gdbarch_unwind_sp (gdbarch, m68hc11_unwind_sp);
-
   /* Set register info.  */
   set_gdbarch_fp0_regnum (gdbarch, -1);
 
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 2e434daa41e..9fa64b2b46d 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -2061,16 +2061,6 @@  static const struct frame_unwind mep_frame_unwind = {
   NULL,
   default_frame_sniffer
 };
-
-
-/* Our general unwinding function can handle unwinding the SP.  */
-static CORE_ADDR
-mep_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, MEP_SP_REGNUM);
-}
-
-
 
 /* Return values.  */
 
@@ -2446,7 +2436,6 @@  mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Frames and frame unwinding.  */
   frame_unwind_append_unwinder (gdbarch, &mep_frame_unwind);
-  set_gdbarch_unwind_sp (gdbarch, mep_unwind_sp);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 3b366e9322d..1dda06310cc 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1140,21 +1140,11 @@  static const struct frame_unwind mn10300_frame_unwind = {
   default_frame_sniffer
 };
 
-static CORE_ADDR
-mn10300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  ULONGEST sp;
-
-  sp = frame_unwind_register_unsigned (this_frame, E_SP_REGNUM);
-  return sp;
-}
-
 static void
 mn10300_frame_unwind_init (struct gdbarch *gdbarch)
 {
   dwarf2_append_unwinders (gdbarch);
   frame_unwind_append_unwinder (gdbarch, &mn10300_frame_unwind);
-  set_gdbarch_unwind_sp (gdbarch, mn10300_unwind_sp);
 }
 
 /* Function: push_dummy_call
@@ -1288,7 +1278,7 @@  mn10300_push_dummy_call (struct gdbarch *gdbarch,
   {
     CORE_ADDR func_addr = find_function_addr (target_func, NULL);
     CORE_ADDR unwound_sp 
-      = mn10300_unwind_sp (gdbarch, create_new_frame (sp, func_addr));
+      = gdbarch_unwind_sp (gdbarch, create_new_frame (sp, func_addr));
     if (sp != unwound_sp)
       regcache_cooked_write_unsigned (regcache, E_SP_REGNUM,
                                       sp - (unwound_sp - sp));
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index ca235050df5..9835545ab27 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -447,14 +447,6 @@  moxie_software_single_step (struct regcache *regcache)
   return next_pcs;
 }
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-moxie_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, MOXIE_SP_REGNUM);
-}
-
 /* Given a return value in `regbuf' with a type `valtype', 
    extract and copy its value into `valbuf'.  */
 
@@ -1073,8 +1065,6 @@  moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_wchar_bit (gdbarch, 32);
   set_gdbarch_wchar_signed (gdbarch, 0);
 
-  set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp);
-
   set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS);
   set_gdbarch_sp_regnum (gdbarch, MOXIE_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, MOXIE_PC_REGNUM);
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index 3f09b594f8b..b53ad567cb1 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -447,14 +447,6 @@  msp430_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   return p.prologue_end;
 }
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-msp430_unwind_sp (struct gdbarch *arch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, MSP430_SP_REGNUM);
-}
-
 /* Given a frame described by THIS_FRAME, decode the prologue of its
    associated function if there is not cache entry as specified by
    THIS_PROLOGUE_CACHE.  Save the decoded prologue in the cache and
@@ -975,7 +967,6 @@  msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Frames, prologues, etc.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_skip_prologue (gdbarch, msp430_skip_prologue);
-  set_gdbarch_unwind_sp (gdbarch, msp430_unwind_sp);
   set_gdbarch_frame_align (gdbarch, msp430_frame_align);
   dwarf2_append_unwinders (gdbarch);
   frame_unwind_append_unwinder (gdbarch, &msp430_unwind);
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 5df7054f621..6a50d4f0c94 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -1388,14 +1388,6 @@  static const struct frame_unwind nds32_epilogue_frame_unwind =
   nds32_epilogue_frame_sniffer
 };
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-nds32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, NDS32_SP_REGNUM);
-}
-
 /* Floating type and struct type that has only one floating type member
    can pass value using FPU registers (when FPU ABI is used).  */
 
@@ -2120,7 +2112,6 @@  nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_sp_regnum (gdbarch, NDS32_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, NDS32_PC_REGNUM);
-  set_gdbarch_unwind_sp (gdbarch, nds32_unwind_sp);
   set_gdbarch_stack_frame_destroyed_p (gdbarch, nds32_stack_frame_destroyed_p);
   set_gdbarch_dwarf2_reg_to_regnum (gdbarch, nds32_dwarf2_reg_to_regnum);
 
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index f41fde2da2f..7e0cb3327b3 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1878,14 +1878,6 @@  nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   return sp;
 }
 
-/* Implement the unwind_sp gdbarch method.  */
-
-static CORE_ADDR
-nios2_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_unwind_register_unsigned (this_frame, NIOS2_SP_REGNUM);
-}
-
 /* Use prologue analysis to fill in the register cache
    *THIS_PROLOGUE_CACHE for THIS_FRAME.  This function initializes
    *THIS_PROLOGUE_CACHE first.  */
@@ -2300,8 +2292,6 @@  nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, nios2_breakpoint_kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind);
 
-  set_gdbarch_unwind_sp (gdbarch, nios2_unwind_sp);
-
   /* The dwarf2 unwinder will normally produce the best results if
      the debug information is available, so register it first.  */
   dwarf2_append_unwinders (gdbarch);
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 7ef04627bef..7c35b129b48 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2322,14 +2322,6 @@  riscv_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
   return align_down (addr, 16);
 }
 
-/* Implement the unwind_sp gdbarch method.  */
-
-static CORE_ADDR
-riscv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, RISCV_SP_REGNUM);
-}
-
 /* Generate, or return the cached frame cache for the RiscV frame
    unwinder.  */
 
@@ -2526,9 +2518,6 @@  riscv_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_frame_align (gdbarch, riscv_frame_align);
 
-  /* Functions to access frame data.  */
-  set_gdbarch_unwind_sp (gdbarch, riscv_unwind_sp);
-
   /* Functions handling dummy frames.  */
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
   set_gdbarch_push_dummy_code (gdbarch, riscv_push_dummy_code);
diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
index 70955d966fa..5418a480bb7 100644
--- a/gdb/rl78-tdep.c
+++ b/gdb/rl78-tdep.c
@@ -1074,14 +1074,6 @@  rl78_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   return p.prologue_end;
 }
 
-/* Implement the "unwind_sp" gdbarch method.  */
-
-static CORE_ADDR
-rl78_unwind_sp (struct gdbarch *arch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, RL78_SP_REGNUM);
-}
-
 /* Given a frame described by THIS_FRAME, decode the prologue of its
    associated function if there is not cache entry as specified by
    THIS_PROLOGUE_CACHE.  Save the decoded prologue in the cache and
@@ -1458,7 +1450,6 @@  rl78_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Frames, prologues, etc.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_skip_prologue (gdbarch, rl78_skip_prologue);
-  set_gdbarch_unwind_sp (gdbarch, rl78_unwind_sp);
   set_gdbarch_frame_align (gdbarch, rl78_frame_align);
 
   dwarf2_append_unwinders (gdbarch);
diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
index 07e83d0e11e..9c85c3cc232 100644
--- a/gdb/rx-tdep.c
+++ b/gdb/rx-tdep.c
@@ -751,16 +751,6 @@  static const struct frame_unwind rx_exception_unwind = {
   rx_exception_sniffer
 };
 
-/* Implement the "unwind_sp" gdbarch method.  */
-static CORE_ADDR
-rx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  ULONGEST sp;
-
-  sp = frame_unwind_register_unsigned (this_frame, RX_SP_REGNUM);
-  return sp;
-}
-
 /* Implement the "push_dummy_call" gdbarch method.  */
 static CORE_ADDR
 rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
@@ -1091,8 +1081,6 @@  rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind);
   set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue);
 
-  set_gdbarch_unwind_sp (gdbarch, rx_unwind_sp);
-
   /* Target builtin data types.  */
   set_gdbarch_char_signed (gdbarch, 0);
   set_gdbarch_short_bit (gdbarch, 16);
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index f2d831899d1..67ea08154bd 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -64,12 +64,6 @@  score_register_type (struct gdbarch *gdbarch, int regnum)
   return builtin_type (gdbarch)->builtin_uint32;
 }
 
-static CORE_ADDR
-score_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, SCORE_SP_REGNUM);
-}
-
 static const char *
 score7_register_name (struct gdbarch *gdbarch, int regnum)
 {
@@ -1465,7 +1459,6 @@  score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_type (gdbarch, score_register_type);
   set_gdbarch_frame_align (gdbarch, score_frame_align);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  set_gdbarch_unwind_sp (gdbarch, score_unwind_sp);
 
   switch (target_mach)
     {
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index a65fd170c02..b7407375d0d 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1975,13 +1975,6 @@  static const struct frame_unwind sh_frame_unwind = {
   default_frame_sniffer
 };
 
-static CORE_ADDR
-sh_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame,
-					 gdbarch_sp_regnum (gdbarch));
-}
-
 static CORE_ADDR
 sh_frame_base_address (struct frame_info *this_frame, void **this_cache)
 {
@@ -2290,7 +2283,6 @@  sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
   set_gdbarch_frame_align (gdbarch, sh_frame_align);
-  set_gdbarch_unwind_sp (gdbarch, sh_unwind_sp);
   frame_base_set_default (gdbarch, &sh_frame_base);
 
   set_gdbarch_stack_frame_destroyed_p (gdbarch, sh_stack_frame_destroyed_p);
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 84fad648db1..78b90a4bec9 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -366,15 +366,6 @@  tic6x_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
     reg->how = DWARF2_FRAME_REG_UNDEFINED;
 }
 
-/* This is the implementation of gdbarch method unwind_sp.  */
-
-static CORE_ADDR
-tic6x_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_unwind_register_unsigned (this_frame, TIC6X_SP_REGNUM);
-}
-
-
 /* Frame base handling.  */
 
 static struct tic6x_unwind_cache*
@@ -1263,8 +1254,6 @@  tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_sw_breakpoint_from_kind (gdbarch,
 				       tic6x_sw_breakpoint_from_kind);
 
-  set_gdbarch_unwind_sp (gdbarch, tic6x_unwind_sp);
-
   /* Unwinding.  */
   dwarf2_append_unwinders (gdbarch);
 
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index f8a8153bb3e..4f7bc9cfbc4 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -930,12 +930,6 @@  static const struct frame_base tilegx_frame_base = {
   tilegx_frame_base_address
 };
 
-static CORE_ADDR
-tilegx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, TILEGX_SP_REGNUM);
-}
-
 /* We cannot read/write the "special" registers.  */
 
 static int
@@ -1010,7 +1004,6 @@  tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   /* Frame Info.  */
-  set_gdbarch_unwind_sp (gdbarch, tilegx_unwind_sp);
   set_gdbarch_frame_align (gdbarch, tilegx_frame_align);
   frame_base_set_default (gdbarch, &tilegx_frame_base);
 
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 6434ceb1de4..719e1598ec9 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1326,13 +1326,6 @@  static const struct frame_unwind v850_frame_unwind = {
   default_frame_sniffer
 };
 
-static CORE_ADDR
-v850_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame,
-					 gdbarch_sp_regnum (gdbarch));
-} 
-
 static CORE_ADDR
 v850_frame_base_address (struct frame_info *this_frame, void **this_cache)
 {
@@ -1449,7 +1442,6 @@  v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue);
 
   set_gdbarch_frame_align (gdbarch, v850_frame_align);
-  set_gdbarch_unwind_sp (gdbarch, v850_unwind_sp);
   frame_base_set_default (gdbarch, &v850_frame_base);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index ee378600958..43b252a332e 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -751,12 +751,6 @@  static const struct frame_base xstormy16_frame_base = {
   xstormy16_frame_base_address
 };
 
-static CORE_ADDR
-xstormy16_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-}
-
 /* Function: xstormy16_gdbarch_init
    Initializer function for the xstormy16 gdbarch vector.
    Called by gdbarch.  Sets up the gdbarch vector(s) for this target.  */
@@ -810,7 +804,6 @@  xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /*
    * Frame Info
    */
-  set_gdbarch_unwind_sp (gdbarch, xstormy16_unwind_sp);
   set_gdbarch_frame_align (gdbarch, xstormy16_frame_align);
   frame_base_set_default (gdbarch, &xstormy16_frame_base);