@@ -54,6 +54,7 @@
class aarch64_target : public linux_process_target
{
public:
+ aarch64_target () : linux_process_target (0) { }
const regs_info *get_regs_info () override;
@@ -3103,7 +3104,6 @@ aarch64_supports_hardware_single_step (void)
struct linux_target_ops the_low_target =
{
- 0, /* decr_pc_after_break */
aarch64_breakpoint_at,
aarch64_supports_z_point_type,
aarch64_insert_point,
@@ -60,6 +60,8 @@ class arm_target : public linux_process_target
{
public:
+ arm_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
int breakpoint_kind_from_pc (CORE_ADDR *pcptr) override;
@@ -1085,7 +1087,6 @@ arm_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
arm_breakpoint_at,
arm_supports_z_point_type,
arm_insert_point,
@@ -29,6 +29,8 @@ class bfin_target : public linux_process_target
{
public:
+ bfin_target () : linux_process_target (2) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -161,7 +163,6 @@ bfin_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 2,
bfin_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -26,6 +26,8 @@ class cris_target : public linux_process_target
{
public:
+ cris_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -158,7 +160,6 @@ cris_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
cris_breakpoint_at,
};
@@ -26,6 +26,8 @@ class crisv32_target : public linux_process_target
{
public:
+ crisv32_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -455,7 +457,6 @@ crisv32_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
cris_breakpoint_at,
cris_supports_z_point_type,
cris_insert_point,
@@ -29,6 +29,8 @@ class ia64_target : public linux_process_target
{
public:
+ ia64_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -281,6 +281,12 @@ static int check_ptrace_stopped_lwp_gone (struct lwp_info *lp);
being stepped. */
ptid_t step_over_bkpt;
+linux_process_target::linux_process_target (int decr_pc_after_break)
+ : m_decr_pc_after_break {decr_pc_after_break}
+{
+ /* Nop. */
+}
+
/* True if the low target can hardware single-step. */
static int
@@ -796,7 +802,7 @@ linux_process_target::save_stop_reason (lwp_info *lwp)
return false;
pc = get_pc (lwp);
- sw_breakpoint_pc = pc - the_low_target.decr_pc_after_break;
+ sw_breakpoint_pc = pc - this->m_decr_pc_after_break;
/* breakpoint_at reads from the current thread. */
saved_thread = current_thread;
@@ -3694,7 +3700,7 @@ linux_process_target::wait_1 (ptid_t ptid, target_waitstatus *ourstatus,
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 = this->m_decr_pc_after_break;
if (decr_pc != 0)
{
@@ -131,7 +131,6 @@ struct lwp_info;
struct linux_target_ops
{
- int decr_pc_after_break;
int (*breakpoint_at) (CORE_ADDR pc);
/* Breakpoint and watchpoint related functions. See target.h for
@@ -237,6 +236,8 @@ class linux_process_target : public process_stratum_target
{
public:
+ linux_process_target (int decr_pc_after_break);
+
int create_inferior (const char *program,
const std::vector<char *> &program_args) override;
@@ -666,6 +667,9 @@ class linux_process_target : public process_stratum_target
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. */
+ int m_decr_pc_after_break;
};
extern linux_process_target *the_linux_target;
@@ -29,6 +29,8 @@ class m32r_target : public linux_process_target
{
public:
+ m32r_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -160,7 +162,6 @@ m32r_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
m32r_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -25,6 +25,8 @@ class m68k_target : public linux_process_target
{
public:
+ m68k_target () : linux_process_target (2) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -255,7 +257,6 @@ m68k_supports_hardware_single_step (void)
}
struct linux_target_ops the_low_target = {
- 2,
m68k_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -31,6 +31,8 @@ class mips_target : public linux_process_target
{
public:
+ mips_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -966,7 +968,6 @@ mips_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
mips_breakpoint_at,
mips_supports_z_point_type,
mips_insert_point,
@@ -37,6 +37,8 @@ class nios2_target : public linux_process_target
{
public:
+ nios2_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -277,7 +279,6 @@ nios2_target::get_regs_info ()
struct linux_target_ops the_low_target =
{
- 0,
nios2_breakpoint_at,
};
@@ -50,6 +50,8 @@ class ppc_target : public linux_process_target
{
public:
+ ppc_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -3406,7 +3408,6 @@ ppc_get_ipa_tdesc_idx (void)
}
struct linux_target_ops the_low_target = {
- 0,
ppc_breakpoint_at,
ppc_supports_z_point_type,
ppc_insert_point,
@@ -36,6 +36,8 @@ class riscv_target : public linux_process_target
{
public:
+ riscv_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
int breakpoint_kind_from_pc (CORE_ADDR *pcptr) override;
@@ -309,7 +311,6 @@ riscv_breakpoint_at (CORE_ADDR pc)
/* RISC-V/Linux target operations. */
struct linux_target_ops the_low_target =
{
- 0, /* decr_pc_after_break */
riscv_breakpoint_at,
};
@@ -51,12 +51,17 @@
#define s390_num_regs 52
+static const gdb_byte s390_breakpoint[] = { 0, 1 };
+#define s390_breakpoint_len 2
+
/* Linux target op definitions for the S/390 architecture. */
class s390_target : public linux_process_target
{
public:
+ s390_target () : linux_process_target (s390_breakpoint_len) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -450,9 +455,6 @@ static struct regset_info s390_regsets[] = {
};
-static const gdb_byte s390_breakpoint[] = { 0, 1 };
-#define s390_breakpoint_len 2
-
/* Implementation of target ops method "sw_breakpoint_from_kind". */
const gdb_byte *
@@ -2826,7 +2828,6 @@ s390_emit_ops (void)
}
struct linux_target_ops the_low_target = {
- s390_breakpoint_len,
s390_breakpoint_at,
s390_supports_z_point_type,
NULL,
@@ -25,6 +25,8 @@ class sh_target : public linux_process_target
{
public:
+ sh_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -190,7 +192,6 @@ sh_target::low_arch_setup ()
}
struct linux_target_ops the_low_target = {
- 0,
sh_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -48,6 +48,8 @@ class sparc_target : public linux_process_target
{
public:
+ sparc_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -339,7 +341,6 @@ sparc_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
sparc_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, NULL, NULL, NULL,
@@ -44,6 +44,8 @@ class tic6x_target : public linux_process_target
{
public:
+ tic6x_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -421,7 +423,6 @@ tic6x_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
tic6x_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -29,6 +29,8 @@ class tile_target : public linux_process_target
{
public:
+ tile_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -222,7 +224,6 @@ tile_supports_hardware_single_step (void)
struct linux_target_ops the_low_target =
{
- 0,
tile_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */
@@ -100,6 +100,8 @@ class x86_target : public linux_process_target
{
public:
+ x86_target () : linux_process_target (1) { }
+
/* Update all the target description of all processes; a new GDB
connected, and it may or not support xml target descriptions. */
void update_xmltarget ();
@@ -2899,7 +2901,6 @@ x86_get_ipa_tdesc_idx (void)
struct linux_target_ops the_low_target =
{
- 1,
x86_breakpoint_at,
x86_supports_z_point_type,
x86_insert_point,
@@ -26,6 +26,8 @@ class xtensa_target : public linux_process_target
{
public:
+ xtensa_target () : linux_process_target (0) { }
+
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
@@ -328,7 +330,6 @@ xtensa_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- 0,
xtensa_breakpoint_at,
NULL, /* supports_z_point_type */
NULL, /* insert_point */