+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Turn the 'insert_point' and 'remove_point' linux target ops into
+ methods of linux_process_target.
+
+ * linux-low.h (struct linux_target_ops): Remove the ops.
+ (class linux_process_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ * linux-low.cc (linux_process_target::low_insert_point)
+ (linux_process_target::low_remove_point): Define.
+ (linux_process_target::insert_point)
+ (linux_process_target::remove_point): Update for calls to
+ low_insert_point and low_remove_point.
+ * linux-x86-low.cc (class x86_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (x86_insert_point): Turn into...
+ (x86_target::low_insert_point): ...this.
+ (x86_remove_point): Turn into...
+ (x86_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-aarch64-low.cc (class aarch64_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (aarch64_insert_point): Turn into...
+ (aarch64_target::low_insert_point): ...this.
+ (aarch64_remove_point): Turn into...
+ (aarch64_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-arm-low.cc (class arm_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (arm_insert_point): Turn into...
+ (arm_target::low_insert_point): ...this.
+ (arm_remove_point): Turn into...
+ (arm_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-crisv32-low.cc (class crisv32_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (crisv32_insert_point): Turn into...
+ (crisv32_target::low_insert_point): ...this.
+ (crisv32_remove_point): Turn into...
+ (crisv32_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-mips-low.cc (class mips_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (mips_insert_point): Turn into...
+ (mips_target::low_insert_point): ...this.
+ (mips_remove_point): Turn into...
+ (mips_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-ppc-low.cc (class ppc_target) <low_insert_point>
+ <low_remove_point>: Declare.
+ (ppc_insert_point): Turn into...
+ (ppc_target::low_insert_point): ...this.
+ (ppc_remove_point): Turn into...
+ (ppc_target::low_remove_point): ...this.
+ (the_low_target): Remove the op fields.
+ * linux-bfin-low.cc (the_low_target): Remove the op fields.
+ * linux-m32r-low.cc (the_low_target): Ditto.
+ * linux-m68k-low.cc (the_low_target): Ditto.
+ * linux-s390-low.cc (the_low_target): Ditto.
+ * linux-sh-low.cc (the_low_target): Ditto.
+ * linux-sparc-low.cc (the_low_target): Ditto.
+ * linux-tic6x-low.cc (the_low_target): Ditto.
+ * linux-tile-low.cc (the_low_target): Ditto.
+ * linux-xtensa-low.cc (the_low_target): Ditto.
+
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'supports_z_point_type' linux target op and let the
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
}
-/* Implementation of linux_target_ops method "insert_point".
+/* Implementation of linux target ops method "low_insert_point".
It actually only records the info of the to-be-inserted bp/wp;
the actual insertion will happen when threads are resumed. */
-static int
-aarch64_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+aarch64_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
int ret;
enum target_hw_bp_type targ_type;
return ret;
}
-/* Implementation of linux_target_ops method "remove_point".
+/* Implementation of linux target ops method "low_remove_point".
It actually only records the info of the to-be-removed bp/wp,
the actual removal will be done when threads are resumed. */
-static int
-aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+aarch64_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
int ret;
enum target_hw_bp_type targ_type;
struct linux_target_ops the_low_target =
{
- aarch64_insert_point,
- aarch64_remove_point,
aarch64_stopped_by_watchpoint,
aarch64_stopped_data_address,
NULL, /* collect_ptrace_register */
std::vector<CORE_ADDR> low_get_next_pcs (regcache *regcache) override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
/* Insert hardware break-/watchpoint. */
-static int
-arm_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+arm_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arm_linux_hw_breakpoint p, *pts;
}
/* Remove hardware break-/watchpoint. */
-static int
-arm_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+arm_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arm_linux_hw_breakpoint p, *pts;
}
struct linux_target_ops the_low_target = {
- arm_insert_point,
- arm_remove_point,
arm_stopped_by_watchpoint,
arm_stopped_data_address,
NULL, /* collect_ptrace_register */
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
}
-static int
-cris_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+crisv32_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
int bp;
unsigned long bp_ctrl;
return 0;
}
-static int
-cris_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int len,
- struct raw_breakpoint *bp)
+int
+crisv32_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
int bp;
unsigned long bp_ctrl;
}
struct linux_target_ops the_low_target = {
- cris_insert_point,
- cris_remove_point,
cris_stopped_by_watchpoint,
cris_stopped_data_address,
NULL, /* collect_ptrace_register */
{
if (type == raw_bkpt_type_sw)
return insert_memory_breakpoint (bp);
- else if (the_low_target.insert_point != NULL)
- return the_low_target.insert_point (type, addr, size, bp);
else
- /* Unsupported (see target.h). */
- return 1;
+ return low_insert_point (type, addr, size, bp);
+}
+
+int
+linux_process_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
+{
+ /* Unsupported (see target.h). */
+ return 1;
}
int
{
if (type == raw_bkpt_type_sw)
return remove_memory_breakpoint (bp);
- else if (the_low_target.remove_point != NULL)
- return the_low_target.remove_point (type, addr, size, bp);
else
- /* Unsupported (see target.h). */
- return 1;
+ return low_remove_point (type, addr, size, bp);
+}
+
+int
+linux_process_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
+{
+ /* Unsupported (see target.h). */
+ return 1;
}
/* Implement the stopped_by_sw_breakpoint target_ops
struct linux_target_ops
{
- /* Breakpoint and watchpoint related functions. See target.h for
- comments. */
- int (*insert_point) (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp);
- int (*remove_point) (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp);
-
int (*stopped_by_watchpoint) (void);
CORE_ADDR (*stopped_data_address) (void);
/* Return true if there is a breakpoint at PC. */
virtual bool low_breakpoint_at (CORE_ADDR pc) = 0;
+ /* Breakpoint and watchpoint related functions. See target.h for
+ comments. */
+ virtual int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp);
+
+ virtual int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp);
+
/* How many bytes the PC should be decremented after a break. */
virtual int low_decr_pc_after_break ();
};
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
}
-/* This is the implementation of linux_target_ops method
- insert_point. */
+/* This is the implementation of linux target ops method
+ low_insert_point. */
-static int
-mips_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+mips_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
return 0;
}
-/* This is the implementation of linux_target_ops method
- remove_point. */
+/* This is the implementation of linux target ops method
+ low_remove_point. */
-static int
-mips_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
}
struct linux_target_ops the_low_target = {
- mips_insert_point,
- mips_remove_point,
mips_stopped_by_watchpoint,
mips_stopped_data_address,
mips_collect_ptrace_register,
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
}
-/* Implement insert_point target-ops.
+/* Implement the low_insert_point linux target op.
Returns 0 on success, -1 on failure and 1 on unsupported. */
-static int
-ppc_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp)
+int
+ppc_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
{
switch (type)
{
}
}
-/* Implement remove_point target-ops.
+/* Implement the low_remove_point linux target op.
Returns 0 on success, -1 on failure and 1 on unsupported. */
-static int
-ppc_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp)
+int
+ppc_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
{
switch (type)
{
}
struct linux_target_ops the_low_target = {
- ppc_insert_point,
- ppc_remove_point,
NULL,
NULL,
ppc_collect_ptrace_register,
}
struct linux_target_ops the_low_target = {
- NULL,
- NULL,
NULL,
NULL,
s390_collect_ptrace_register,
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
}
struct linux_target_ops the_low_target = {
- NULL, NULL, NULL, NULL,
+ NULL, NULL,
NULL, NULL
};
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
struct linux_target_ops the_low_target =
{
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */
int low_decr_pc_after_break () override;
bool low_breakpoint_at (CORE_ADDR pc) override;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
};
/* The singleton target ops object. */
}
}
-static int
-x86_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp)
+int
+x86_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
}
}
-static int
-x86_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, struct raw_breakpoint *bp)
+int
+x86_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct linux_target_ops the_low_target =
{
- x86_insert_point,
- x86_remove_point,
x86_stopped_by_watchpoint,
x86_stopped_data_address,
/* collect_ptrace_register/supply_ptrace_register are not needed in the
}
struct linux_target_ops the_low_target = {
- NULL, /* insert_point */
- NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* collect_ptrace_register */