@@ -3069,18 +3069,6 @@ arm_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
get_frame_pc (this_frame));
}
-/* Given THIS_FRAME, find the previous frame's resume PC (which will
- be used to construct the previous frame's ID, after looking up the
- containing function). */
-
-static CORE_ADDR
-arm_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- CORE_ADDR pc;
- pc = frame_unwind_register_unsigned (this_frame, ARM_PC_REGNUM);
- return arm_addr_bits_remove (gdbarch, pc);
-}
-
static CORE_ADDR
arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
@@ -9364,7 +9352,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Frame handling. */
set_gdbarch_dummy_id (gdbarch, arm_dummy_id);
- set_gdbarch_unwind_pc (gdbarch, arm_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp);
frame_base_set_default (gdbarch, &arm_normal_base);
@@ -198,8 +198,20 @@ default_frame_unwind_stop_reason (struct frame_info *this_frame,
CORE_ADDR
default_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- int pc_regnum = gdbarch_pc_regnum (gdbarch);
- return frame_unwind_register_unsigned (next_frame, pc_regnum);
+ struct type *type;
+ int pc_regnum;
+ CORE_ADDR addr;
+ struct value *value;
+
+ pc_regnum = gdbarch_pc_regnum (gdbarch);
+ value = frame_unwind_register_value (next_frame, pc_regnum);
+ type = builtin_type (gdbarch)->builtin_func_ptr;
+ addr = extract_typed_address (value_contents_all (value), type);
+ addr = gdbarch_addr_bits_remove (gdbarch, addr);
+
+ release_value (value);
+ value_free (value);
+ return addr;
}
/* Helper functions for value-based register unwinding. These return
@@ -1954,17 +1954,6 @@ i386_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return pc;
}
-
-/* This function is 64-bit safe. */
-
-static CORE_ADDR
-i386_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- gdb_byte buf[8];
-
- frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
- return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
-}
/* Normal frames. */
@@ -8486,8 +8475,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_dummy_id (gdbarch, i386_dummy_id);
- set_gdbarch_unwind_pc (gdbarch, i386_unwind_pc);
-
/* Add the i386 register groups. */
i386_add_reggroups (gdbarch);
tdep->register_reggroup_p = i386_register_reggroup_p;
@@ -851,15 +851,6 @@ m68k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
return start_pc;
return pc;
}
-
-static CORE_ADDR
-m68k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- gdb_byte buf[8];
-
- frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
- return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
-}
/* Normal frames. */
@@ -1247,7 +1238,6 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Frame unwinder. */
set_gdbarch_dummy_id (gdbarch, m68k_dummy_id);
- set_gdbarch_unwind_pc (gdbarch, m68k_unwind_pc);
/* Hook in the DWARF CFI frame unwinder. */
dwarf2_append_unwinders (gdbarch);
@@ -103,15 +103,6 @@ constexpr gdb_byte m88k_break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
typedef BP_MANIPULATION (m88k_break_insn) m88k_breakpoint;
-static CORE_ADDR
-m88k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- CORE_ADDR pc;
-
- pc = frame_unwind_register_unsigned (next_frame, M88K_SXIP_REGNUM);
- return m88k_addr_bits_remove (gdbarch, pc);
-}
-
static void
m88k_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
@@ -832,7 +823,6 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Register numbers of various important registers. */
set_gdbarch_sp_regnum (gdbarch, M88K_R31_REGNUM);
- set_gdbarch_pc_regnum (gdbarch, M88K_SXIP_REGNUM);
/* Core file support. */
set_gdbarch_iterate_over_regset_sections
@@ -853,7 +843,6 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove);
set_gdbarch_breakpoint_kind_from_pc (gdbarch, m88k_breakpoint::kind_from_pc);
set_gdbarch_sw_breakpoint_from_kind (gdbarch, m88k_breakpoint::bp_from_kind);
- set_gdbarch_unwind_pc (gdbarch, m88k_unwind_pc);
set_gdbarch_write_pc (gdbarch, m88k_write_pc);
frame_base_set_default (gdbarch, &m88k_frame_base);
@@ -1888,17 +1888,6 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
return sp;
}
-/* Implement the unwind_pc gdbarch method. */
-
-static CORE_ADDR
-nios2_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- gdb_byte buf[4];
-
- frame_unwind_register (next_frame, NIOS2_PC_REGNUM, buf);
- return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
-}
-
/* Implement the unwind_sp gdbarch method. */
static CORE_ADDR
@@ -2186,7 +2175,7 @@ nios2_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
/* If ra is in the reglist, we have to use the value saved in the
stack frame rather than the current value. */
if (uimm & (1 << NIOS2_RA_REGNUM))
- pc = nios2_unwind_pc (gdbarch, get_current_frame ());
+ pc = gdbarch_unwind_pc (gdbarch, get_current_frame ());
else
pc = regcache_raw_get_unsigned (regcache, NIOS2_RA_REGNUM);
}
@@ -2322,7 +2311,6 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind);
set_gdbarch_dummy_id (gdbarch, nios2_dummy_id);
- set_gdbarch_unwind_pc (gdbarch, nios2_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, nios2_unwind_sp);
/* The dwarf2 unwinder will normally produce the best results if
@@ -1074,16 +1074,6 @@ rl78_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return p.prologue_end;
}
-/* Implement the "unwind_pc" gdbarch method. */
-
-static CORE_ADDR
-rl78_unwind_pc (struct gdbarch *arch, struct frame_info *next_frame)
-{
- return rl78_addr_bits_remove
- (arch, frame_unwind_register_unsigned (next_frame,
- RL78_PC_REGNUM));
-}
-
/* Implement the "unwind_sp" gdbarch method. */
static CORE_ADDR
@@ -1468,7 +1458,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_pc (gdbarch, rl78_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, rl78_unwind_sp);
set_gdbarch_frame_align (gdbarch, rl78_frame_align);
@@ -2129,17 +2129,6 @@ s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
return 0;
}
-/* Implement unwind_pc gdbarch method. */
-
-static CORE_ADDR
-s390_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- ULONGEST pc;
- pc = frame_unwind_register_unsigned (next_frame, tdep->pc_regnum);
- return gdbarch_addr_bits_remove (gdbarch, pc);
-}
-
/* Implement unwind_sp gdbarch method. */
static CORE_ADDR
@@ -7005,7 +6994,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
dwarf2_frame_set_init_reg (gdbarch, s390_dwarf2_frame_init_reg);
dwarf2_frame_set_adjust_regnum (gdbarch, s390_adjust_frame_regnum);
dwarf2_append_unwinders (gdbarch);
- set_gdbarch_unwind_pc (gdbarch, s390_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, s390_unwind_sp);
switch (info.bfd_arch_info->mach)
@@ -366,17 +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_pc. */
-
-static CORE_ADDR
-tic6x_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- gdb_byte buf[8];
-
- frame_unwind_register (next_frame, TIC6X_PC_REGNUM, buf);
- return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
-}
-
/* This is the implementation of gdbarch method unwind_sp. */
static CORE_ADDR
@@ -1290,7 +1279,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_pc (gdbarch, tic6x_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, tic6x_unwind_sp);
/* Unwinding. */