+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Remove the 'supports_z_point_type' linux target op and let the
+ concrete linux target define it by overriding the op declared in
+ process_stratum_target.
+
+ * linux-low.cc (linux_process_target::supports_z_point_type):
+ Remove.
+ * linux-low.h (struct linux_target_ops): Remove the op.
+ (class linux_process_target) <supports_z_point_type>: Remove.
+ * linux-x86-low.cc (class x86_target) <supports_z_point_type>:
+ Declare.
+ (x86_supports_z_point_type): Turn into...
+ (x86_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-aarch64-low.cc (class aarch64_target)
+ <supports_z_point_type>: Declare.
+ (aarch64_supports_z_point_type): Turn into...
+ (aarch64_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-arm-low.cc (class arm_target) <supports_z_point_type>:
+ Declare.
+ (arm_supports_z_point_type): Turn into...
+ (arm_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-crisv32-low.cc (class crisv32_target)
+ <supports_z_point_type>: Declare.
+ (cris_supports_z_point_type): Turn into...
+ (crisv32_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-mips-low.cc (class mips_target) <supports_z_point_type>:
+ Declare.
+ (mips_supports_z_point_type): Turn into...
+ (mips_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-ppc-low.cc (class ppc_target) <supports_z_point_type>:
+ Declare.
+ (ppc_supports_z_point_type): Turn into...
+ (ppc_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-s390-low.cc (class s390_target) <supports_z_point_type>:
+ Declare.
+ (s390_supports_z_point_type): Turn into...
+ (s390_target::supports_z_point_type): ...this.
+ (the_low_target): Remove the op field.
+ * linux-bfin-low.cc (the_low_target): Remove the op field.
+ * linux-m32r-low.cc (the_low_target): Ditto.
+ * linux-m68k-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>
Turn the 'breakpoint_at' linux target op into a method of
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
return &proc->priv->arch_private->debug_reg_state;
}
-/* Implementation of linux_target_ops method "supports_z_point_type". */
+/* Implementation of target ops method "supports_z_point_type". */
-static int
-aarch64_supports_z_point_type (char z_type)
+bool
+aarch64_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
struct linux_target_ops the_low_target =
{
- aarch64_supports_z_point_type,
aarch64_insert_point,
aarch64_remove_point,
aarch64_stopped_by_watchpoint,
bool supports_software_single_step () override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
linux_stop_lwp (lwp);
}
-static int
-arm_supports_z_point_type (char z_type)
+bool
+arm_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
/* Leave the handling of sw breakpoints with the gdb client. */
- return 0;
+ return false;
}
}
}
struct linux_target_ops the_low_target = {
- arm_supports_z_point_type,
arm_insert_point,
arm_remove_point,
arm_stopped_by_watchpoint,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
}
}
-static int
-cris_supports_z_point_type (char z_type)
+bool
+crisv32_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
}
struct linux_target_ops the_low_target = {
- cris_supports_z_point_type,
cris_insert_point,
cris_remove_point,
cris_stopped_by_watchpoint,
return n;
}
-/* These breakpoint and watchpoint related wrapper functions simply
- pass on the function call if the target has registered a
- corresponding function. */
-
-bool
-linux_process_target::supports_z_point_type (char z_type)
-{
- return (the_low_target.supports_z_point_type != NULL
- && the_low_target.supports_z_point_type (z_type));
-}
-
int
linux_process_target::insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
int size, raw_breakpoint *bp)
{
/* Breakpoint and watchpoint related functions. See target.h for
comments. */
- int (*supports_z_point_type) (char z_type);
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 read_auxv (CORE_ADDR offset, unsigned char *myaddr,
unsigned int len) override;
- bool supports_z_point_type (char z_type) override;
-
int insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
int size, raw_breakpoint *bp) override;
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
}
}
-static int
-mips_supports_z_point_type (char z_type)
+bool
+mips_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
}
struct linux_target_ops the_low_target = {
- mips_supports_z_point_type,
mips_insert_point,
mips_remove_point,
mips_stopped_by_watchpoint,
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
Handling software breakpoint at server side, so tracepoints
and breakpoints can be inserted at the same location. */
-static int
-ppc_supports_z_point_type (char z_type)
+bool
+ppc_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_SW_BP:
- return 1;
+ return true;
case Z_PACKET_HW_BP:
case Z_PACKET_WRITE_WP:
case Z_PACKET_ACCESS_WP:
default:
- return 0;
+ return false;
}
}
}
struct linux_target_ops the_low_target = {
- ppc_supports_z_point_type,
ppc_insert_point,
ppc_remove_point,
NULL,
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
/* Breakpoint/Watchpoint support. */
-/* The "supports_z_point_type" linux_target_ops method. */
+/* The "supports_z_point_type" target ops method. */
-static int
-s390_supports_z_point_type (char z_type)
+bool
+s390_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_SW_BP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
}
struct linux_target_ops the_low_target = {
- s390_supports_z_point_type,
NULL,
NULL,
NULL,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, NULL, NULL, NULL,
NULL, NULL
};
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
struct linux_target_ops the_low_target =
{
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
\f
/* Breakpoint/Watchpoint support. */
-static int
-x86_supports_z_point_type (char z_type)
+bool
+x86_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_HW_BP:
case Z_PACKET_WRITE_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
struct linux_target_ops the_low_target =
{
- x86_supports_z_point_type,
x86_insert_point,
x86_remove_point,
x86_stopped_by_watchpoint,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */