+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Turn the 'decr_pc_after_break' linux_target_ops field into
+ a method of linux_process_target.
+
+ * linux-low.h (struct linux_target_ops)
+ <decr_pc_after_break>: Remove.
+ (class linux_process_target) <low_decr_pc_after_break>: New method
+ declaration.
+ * linux-low.cc (linux_process_target::low_decr_pc_after_break):
+ New method implementation.
+
+ Update the users below.
+
+ (linux_process_target::save_stop_reason)
+ (linux_process_target::wait_1)
+ * linux-x86-low.cc (class x86_target) <low_decr_pc_after_break>:
+ New declaration.
+ (x86_target::low_decr_pc_after_break): New method implementation.
+ (the_low_target): Remove the field.
+ * linux-bfin-low.cc (class bfin_target) <low_decr_pc_after_break>:
+ New declaration.
+ (bfin_target::low_decr_pc_after_break): New method implementation.
+ (the_low_target): Remove the field.
+ * linux-m68k-low.cc (class m68k_target) <low_decr_pc_after_break>:
+ New declaration.
+ (m68k_target::low_decr_pc_after_break): New method implementation.
+ (the_low_target): Remove the field.
+ * linux-s390-low.cc (class s390_target) <low_decr_pc_after_break>:
+ New declaration.
+ (s390_target::low_decr_pc_after_break): New method implementation.
+ (the_low_target): Remove the field.
+ * linux-aarch64-low.cc (the_low_target): Remove the field.
+ * linux-arm-low.cc (the_low_target): Remove the field.
+ * linux-cris-low.cc (the_low_target): Remove the field.
+ * linux-crisv32-low.cc (the_low_target): Remove the field.
+ * linux-m32r-low.cc (the_low_target): Remove the field.
+ * linux-mips-low.cc (the_low_target): Remove the field.
+ * linux-nios2-low.cc (the_low_target): Remove the field.
+ * linux-ppc-low.cc (the_low_target): Remove the field.
+ * linux-riscv-low.cc (the_low_target): Remove the field.
+ * linux-sh-low.cc (the_low_target): Remove the field.
+ * linux-sparc-low.cc (the_low_target): Remove the field.
+ * linux-tic6x-low.cc (the_low_target): Remove the field.
+ * linux-tile-low.cc (the_low_target): Remove the field.
+ * linux-xtensa-low.cc (the_low_target): Remove the field.
+
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'supports_software_single_step' linux target op and let
struct linux_target_ops the_low_target =
{
- 0, /* decr_pc_after_break */
aarch64_breakpoint_at,
aarch64_supports_z_point_type,
aarch64_insert_point,
}
struct linux_target_ops the_low_target = {
- 0,
arm_breakpoint_at,
arm_supports_z_point_type,
arm_insert_point,
CORE_ADDR low_get_pc (regcache *regcache) override;
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+ int low_decr_pc_after_break () override;
};
/* The singleton target ops object. */
linux_set_pc_32bit (regcache, pc);
}
+int
+bfin_target::low_decr_pc_after_break ()
+{
+ return 2;
+}
+
/* Defined in auto-generated file reg-bfin.c. */
void init_registers_bfin (void);
extern const struct target_desc *tdesc_bfin;
}
struct linux_target_ops the_low_target = {
- 2,
bfin_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
}
struct linux_target_ops the_low_target = {
- 0,
cris_breakpoint_at,
};
}
struct linux_target_ops the_low_target = {
- 0,
cris_breakpoint_at,
cris_supports_z_point_type,
cris_insert_point,
"implemented");
}
+int
+linux_process_target::low_decr_pc_after_break ()
+{
+ return 0;
+}
+
/* Returns true if this target can support fast tracepoints. This
does not mean that the in-process agent has been loaded in the
inferior. */
return false;
pc = get_pc (lwp);
- sw_breakpoint_pc = pc - the_low_target.decr_pc_after_break;
+ sw_breakpoint_pc = pc - low_decr_pc_after_break ();
/* breakpoint_at reads from the current thread. */
saved_thread = current_thread;
if (event_child->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
&& !cs.swbreak_feature)
{
- int decr_pc = the_low_target.decr_pc_after_break;
+ int decr_pc = low_decr_pc_after_break ();
if (decr_pc != 0)
{
struct linux_target_ops
{
- int decr_pc_after_break;
int (*breakpoint_at) (CORE_ADDR pc);
/* Breakpoint and watchpoint related functions. See target.h for
Targets that override this method should also override
'supports_software_single_step' to return true. */
virtual std::vector<CORE_ADDR> low_get_next_pcs (regcache *regcache);
+
+ /* How many bytes the PC should be decremented after a break. */
+ virtual int low_decr_pc_after_break ();
};
extern linux_process_target *the_linux_target;
}
struct linux_target_ops the_low_target = {
- 0,
m32r_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
CORE_ADDR low_get_pc (regcache *regcache) override;
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+ int low_decr_pc_after_break () override;
};
/* The singleton target ops object. */
linux_set_pc_32bit (regcache, pc);
}
+int
+m68k_target::low_decr_pc_after_break ()
+{
+ return 2;
+}
+
/* Defined in auto-generated file reg-m68k.c. */
void init_registers_m68k (void);
extern const struct target_desc *tdesc_m68k;
}
struct linux_target_ops the_low_target = {
- 2,
m68k_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
}
struct linux_target_ops the_low_target = {
- 0,
mips_breakpoint_at,
mips_supports_z_point_type,
mips_insert_point,
struct linux_target_ops the_low_target =
{
- 0,
nios2_breakpoint_at,
};
}
struct linux_target_ops the_low_target = {
- 0,
ppc_breakpoint_at,
ppc_supports_z_point_type,
ppc_insert_point,
/* RISC-V/Linux target operations. */
struct linux_target_ops the_low_target =
{
- 0, /* decr_pc_after_break */
riscv_breakpoint_at,
};
CORE_ADDR low_get_pc (regcache *regcache) override;
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+ int low_decr_pc_after_break () override;
};
/* The singleton target ops object. */
}
}
+int
+s390_target::low_decr_pc_after_break ()
+{
+ return s390_breakpoint_len;
+}
+
/* Determine the word size for the given PID, in bytes. */
#ifdef __s390x__
}
struct linux_target_ops the_low_target = {
- s390_breakpoint_len,
s390_breakpoint_at,
s390_supports_z_point_type,
NULL,
}
struct linux_target_ops the_low_target = {
- 0,
sh_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
}
struct linux_target_ops the_low_target = {
- 0,
sparc_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, NULL, NULL, NULL,
}
struct linux_target_ops the_low_target = {
- 0,
tic6x_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
struct linux_target_ops the_low_target =
{
- 0,
tile_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
CORE_ADDR low_get_pc (regcache *regcache) override;
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+ int low_decr_pc_after_break () override;
};
/* The singleton target ops object. */
supply_register_by_name (regcache, "eip", &newpc);
}
}
+
+int
+x86_target::low_decr_pc_after_break ()
+{
+ return 1;
+}
+
\f
static const gdb_byte x86_breakpoint[] = { 0xCC };
#define x86_breakpoint_len 1
struct linux_target_ops the_low_target =
{
- 1,
x86_breakpoint_at,
x86_supports_z_point_type,
x86_insert_point,
}
struct linux_target_ops the_low_target = {
- 0,
xtensa_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */