Remove some $ARCH_read_pc and $ARCH_write_pc
Nowadays, gdbarch_read_pc is called in this way, if (gdbarch_read_pc_p (gdbarch)) pc_val = gdbarch_read_pc (gdbarch, regcache); /* Else use per-frame method on get_current_frame. */ else if (gdbarch_pc_regnum (gdbarch) >= 0) { ULONGEST raw_val; if (regcache_cooked_read_unsigned (regcache, gdbarch_pc_regnum (gdbarch), &raw_val) == REG_UNAVAILABLE) some ports don't have to define its own gdbarch read_pc method if the pc value is simply a unsigned value from "pc" register. The same rule applies to regcache_write_pc. This patch removes these $ARCH_read_pc and $ARCH_write_pc functions. gdb: 2018-02-06 Yao Qi <yao.qi@linaro.org> * ft32-tdep.c (ft32_read_pc): Remove. (ft32_write_pc): Remove. (ft32_gdbarch_init): Update. * m32r-tdep.c (m32r_read_pc): Remove. (m32r_gdbarch_init): Update. * mep-tdep.c (mep_read_pc): Remove. (mep_gdbarch_init): Update. * microblaze-tdep.c (microblaze_write_pc): Remove. (microblaze_gdbarch_init): Update. * mn10300-tdep.c (mn10300_read_pc): Remove. (mn10300_write_pc): Remove. (mn10300_gdbarch_init): Update. * moxie-tdep.c (moxie_read_pc): Remove. (moxie_write_pc): Remove. (moxie_gdbarch_init): Update.
This commit is contained in:
parent
c20c30f615
commit
3f8c94b478
7 changed files with 18 additions and 85 deletions
|
@ -1,3 +1,21 @@
|
|||
2018-02-06 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* ft32-tdep.c (ft32_read_pc): Remove.
|
||||
(ft32_write_pc): Remove.
|
||||
(ft32_gdbarch_init): Update.
|
||||
* m32r-tdep.c (m32r_read_pc): Remove.
|
||||
(m32r_gdbarch_init): Update.
|
||||
* mep-tdep.c (mep_read_pc): Remove.
|
||||
(mep_gdbarch_init): Update.
|
||||
* microblaze-tdep.c (microblaze_write_pc): Remove.
|
||||
(microblaze_gdbarch_init): Update.
|
||||
* mn10300-tdep.c (mn10300_read_pc): Remove.
|
||||
(mn10300_write_pc): Remove.
|
||||
(mn10300_gdbarch_init): Update.
|
||||
* moxie-tdep.c (moxie_read_pc): Remove.
|
||||
(moxie_write_pc): Remove.
|
||||
(moxie_gdbarch_init): Update.
|
||||
|
||||
2018-02-06 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* expprint.c (print_subexp_standard): Handle
|
||||
|
|
|
@ -383,26 +383,6 @@ ft32_address_class_name_to_type_flags (struct gdbarch *gdbarch,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Implement the "read_pc" gdbarch method. */
|
||||
|
||||
static CORE_ADDR
|
||||
ft32_read_pc (struct regcache *regcache)
|
||||
{
|
||||
ULONGEST pc;
|
||||
|
||||
regcache_cooked_read_unsigned (regcache, FT32_PC_REGNUM, &pc);
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* Implement the "write_pc" gdbarch method. */
|
||||
|
||||
static void
|
||||
ft32_write_pc (struct regcache *regcache, CORE_ADDR val)
|
||||
{
|
||||
regcache_cooked_write_unsigned (regcache, FT32_PC_REGNUM, val);
|
||||
}
|
||||
|
||||
/* Implement the "unwind_sp" gdbarch method. */
|
||||
|
||||
static CORE_ADDR
|
||||
|
@ -622,8 +602,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_read_pc (gdbarch, ft32_read_pc);
|
||||
set_gdbarch_write_pc (gdbarch, ft32_write_pc);
|
||||
set_gdbarch_unwind_sp (gdbarch, ft32_unwind_sp);
|
||||
|
||||
set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS);
|
||||
|
|
|
@ -649,14 +649,6 @@ m32r_frame_unwind_cache (struct frame_info *this_frame,
|
|||
return info;
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
m32r_read_pc (struct regcache *regcache)
|
||||
{
|
||||
ULONGEST pc;
|
||||
regcache_cooked_read_unsigned (regcache, M32R_PC_REGNUM, &pc);
|
||||
return pc;
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
m32r_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
||||
{
|
||||
|
@ -912,7 +904,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_read_pc (gdbarch, m32r_read_pc);
|
||||
set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp);
|
||||
|
||||
set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS);
|
||||
|
|
|
@ -1112,15 +1112,6 @@ mep_register_type (struct gdbarch *gdbarch, int reg_nr)
|
|||
return builtin_type (gdbarch)->builtin_uint32;
|
||||
}
|
||||
|
||||
|
||||
static CORE_ADDR
|
||||
mep_read_pc (struct regcache *regcache)
|
||||
{
|
||||
ULONGEST pc;
|
||||
regcache_cooked_read_unsigned (regcache, MEP_PC_REGNUM, &pc);
|
||||
return pc;
|
||||
}
|
||||
|
||||
static enum register_status
|
||||
mep_pseudo_cr32_read (struct gdbarch *gdbarch,
|
||||
struct regcache *regcache,
|
||||
|
@ -2446,7 +2437,6 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
tdep->me_module = me_module;
|
||||
|
||||
/* Register set. */
|
||||
set_gdbarch_read_pc (gdbarch, mep_read_pc);
|
||||
set_gdbarch_num_regs (gdbarch, MEP_NUM_RAW_REGS);
|
||||
set_gdbarch_pc_regnum (gdbarch, MEP_PC_REGNUM);
|
||||
set_gdbarch_sp_regnum (gdbarch, MEP_SP_REGNUM);
|
||||
|
|
|
@ -601,11 +601,6 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
|
|||
return (TYPE_LENGTH (type) == 16);
|
||||
}
|
||||
|
||||
static void
|
||||
microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||
{
|
||||
regcache_cooked_write_unsigned (regcache, MICROBLAZE_PC_REGNUM, pc);
|
||||
}
|
||||
|
||||
static int dwarf2_to_reg_map[78] =
|
||||
{ 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */
|
||||
|
@ -738,8 +733,6 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
|
||||
set_gdbarch_frame_args_skip (gdbarch, 8);
|
||||
|
||||
set_gdbarch_write_pc (gdbarch, microblaze_write_pc);
|
||||
|
||||
set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc);
|
||||
|
||||
microblaze_register_g_packet_guesses (gdbarch);
|
||||
|
|
|
@ -307,20 +307,6 @@ mn10300_register_type (struct gdbarch *gdbarch, int reg)
|
|||
return builtin_type (gdbarch)->builtin_int;
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
mn10300_read_pc (struct regcache *regcache)
|
||||
{
|
||||
ULONGEST val;
|
||||
regcache_cooked_read_unsigned (regcache, E_PC_REGNUM, &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
static void
|
||||
mn10300_write_pc (struct regcache *regcache, CORE_ADDR val)
|
||||
{
|
||||
regcache_cooked_write_unsigned (regcache, E_PC_REGNUM, val);
|
||||
}
|
||||
|
||||
/* The breakpoint instruction must be the same size as the smallest
|
||||
instruction in the instruction set.
|
||||
|
||||
|
@ -1423,8 +1409,6 @@ mn10300_gdbarch_init (struct gdbarch_info info,
|
|||
set_gdbarch_num_regs (gdbarch, num_regs);
|
||||
set_gdbarch_register_type (gdbarch, mn10300_register_type);
|
||||
set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue);
|
||||
set_gdbarch_read_pc (gdbarch, mn10300_read_pc);
|
||||
set_gdbarch_write_pc (gdbarch, mn10300_write_pc);
|
||||
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
|
||||
set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
|
||||
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
|
||||
|
|
|
@ -448,25 +448,6 @@ moxie_software_single_step (struct regcache *regcache)
|
|||
return next_pcs;
|
||||
}
|
||||
|
||||
/* Implement the "read_pc" gdbarch method. */
|
||||
|
||||
static CORE_ADDR
|
||||
moxie_read_pc (struct regcache *regcache)
|
||||
{
|
||||
ULONGEST pc;
|
||||
|
||||
regcache_cooked_read_unsigned (regcache, MOXIE_PC_REGNUM, &pc);
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* Implement the "write_pc" gdbarch method. */
|
||||
|
||||
static void
|
||||
moxie_write_pc (struct regcache *regcache, CORE_ADDR val)
|
||||
{
|
||||
regcache_cooked_write_unsigned (regcache, MOXIE_PC_REGNUM, val);
|
||||
}
|
||||
|
||||
/* Implement the "unwind_sp" gdbarch method. */
|
||||
|
||||
static CORE_ADDR
|
||||
|
@ -1109,8 +1090,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_read_pc (gdbarch, moxie_read_pc);
|
||||
set_gdbarch_write_pc (gdbarch, moxie_write_pc);
|
||||
set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp);
|
||||
|
||||
set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS);
|
||||
|
|
Loading…
Add table
Reference in a new issue