aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:27 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:27 +0200
commit007c9b975dcb9ad50b45d52d2d7a955537beefb7 (patch)
tree1f7bfdda2dade0a383fa3ce3ad9aa1d48b5b8825 /gdbserver
parentd7146cda56c8ee6d1129c0c787c2645c01301fb8 (diff)
downloadfsf-binutils-gdb-007c9b975dcb9ad50b45d52d2d7a955537beefb7.zip
fsf-binutils-gdb-007c9b975dcb9ad50b45d52d2d7a955537beefb7.tar.gz
fsf-binutils-gdb-007c9b975dcb9ad50b45d52d2d7a955537beefb7.tar.bz2
gdbserver/linux-low: turn 'supports_z_point_type' into a method
gdbserver/ChangeLog: 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.
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/ChangeLog54
-rw-r--r--gdbserver/linux-aarch64-low.cc13
-rw-r--r--gdbserver/linux-arm-low.cc11
-rw-r--r--gdbserver/linux-bfin-low.cc1
-rw-r--r--gdbserver/linux-crisv32-low.cc11
-rw-r--r--gdbserver/linux-low.cc11
-rw-r--r--gdbserver/linux-low.h3
-rw-r--r--gdbserver/linux-m32r-low.cc1
-rw-r--r--gdbserver/linux-m68k-low.cc1
-rw-r--r--gdbserver/linux-mips-low.cc11
-rw-r--r--gdbserver/linux-ppc-low.cc11
-rw-r--r--gdbserver/linux-s390-low.cc13
-rw-r--r--gdbserver/linux-sh-low.cc1
-rw-r--r--gdbserver/linux-sparc-low.cc1
-rw-r--r--gdbserver/linux-tic6x-low.cc1
-rw-r--r--gdbserver/linux-tile-low.cc1
-rw-r--r--gdbserver/linux-x86-low.cc11
-rw-r--r--gdbserver/linux-xtensa-low.cc1
18 files changed, 98 insertions, 59 deletions
diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index 1750dbf..5e6861a 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,5 +1,59 @@
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
linux_process_target.
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index 2fc3874..9727d5d 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -63,6 +63,8 @@ public:
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;
@@ -288,10 +290,10 @@ aarch64_get_debug_reg_state (pid_t pid)
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)
{
@@ -300,9 +302,9 @@ aarch64_supports_z_point_type (char 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;
}
}
@@ -3104,7 +3106,6 @@ aarch64_supports_hardware_single_step (void)
struct linux_target_ops the_low_target =
{
- aarch64_supports_z_point_type,
aarch64_insert_point,
aarch64_remove_point,
aarch64_stopped_by_watchpoint,
diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc
index afbe0be..2d6035c 100644
--- a/gdbserver/linux-arm-low.cc
+++ b/gdbserver/linux-arm-low.cc
@@ -70,6 +70,8 @@ public:
bool supports_software_single_step () override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
@@ -556,8 +558,8 @@ update_registers_callback (thread_info *thread, int watch, int i)
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)
{
@@ -566,10 +568,10 @@ arm_supports_z_point_type (char 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;
}
}
@@ -1093,7 +1095,6 @@ arm_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- arm_supports_z_point_type,
arm_insert_point,
arm_remove_point,
arm_stopped_by_watchpoint,
diff --git a/gdbserver/linux-bfin-low.cc b/gdbserver/linux-bfin-low.cc
index 351c7ae..5384fa8 100644
--- a/gdbserver/linux-bfin-low.cc
+++ b/gdbserver/linux-bfin-low.cc
@@ -171,7 +171,6 @@ bfin_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-crisv32-low.cc b/gdbserver/linux-crisv32-low.cc
index 8d84a8d..761e4e2 100644
--- a/gdbserver/linux-crisv32-low.cc
+++ b/gdbserver/linux-crisv32-low.cc
@@ -30,6 +30,8 @@ public:
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;
@@ -177,17 +179,17 @@ cris_write_data_breakpoint (struct regcache *regcache,
}
}
-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;
}
}
@@ -456,7 +458,6 @@ crisv32_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- cris_supports_z_point_type,
cris_insert_point,
cris_remove_point,
cris_stopped_by_watchpoint,
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index b3f8794..9a5c735 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -5829,17 +5829,6 @@ linux_process_target::read_auxv (CORE_ADDR offset, unsigned char *myaddr,
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)
diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index 5dcddc4..c80237c 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -133,7 +133,6 @@ struct linux_target_ops
{
/* 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,
@@ -279,8 +278,6 @@ public:
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;
diff --git a/gdbserver/linux-m32r-low.cc b/gdbserver/linux-m32r-low.cc
index f24f042..2f331b4 100644
--- a/gdbserver/linux-m32r-low.cc
+++ b/gdbserver/linux-m32r-low.cc
@@ -161,7 +161,6 @@ m32r_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc
index 702da95..08a8f16 100644
--- a/gdbserver/linux-m68k-low.cc
+++ b/gdbserver/linux-m68k-low.cc
@@ -265,7 +265,6 @@ m68k_supports_hardware_single_step (void)
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
index b938473..84ad0a0 100644
--- a/gdbserver/linux-mips-low.cc
+++ b/gdbserver/linux-mips-low.cc
@@ -35,6 +35,8 @@ public:
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;
@@ -492,17 +494,17 @@ mips_linux_prepare_to_resume (struct lwp_info *lwp)
}
}
-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;
}
}
@@ -968,7 +970,6 @@ mips_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- mips_supports_z_point_type,
mips_insert_point,
mips_remove_point,
mips_stopped_by_watchpoint,
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
index a8f51eb..6874f06 100644
--- a/gdbserver/linux-ppc-low.cc
+++ b/gdbserver/linux-ppc-low.cc
@@ -54,6 +54,8 @@ public:
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;
@@ -329,18 +331,18 @@ ppc_target::low_breakpoint_at (CORE_ADDR where)
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;
}
}
@@ -3408,7 +3410,6 @@ ppc_get_ipa_tdesc_idx (void)
}
struct linux_target_ops the_low_target = {
- ppc_supports_z_point_type,
ppc_insert_point,
ppc_remove_point,
NULL,
diff --git a/gdbserver/linux-s390-low.cc b/gdbserver/linux-s390-low.cc
index c6e0542..3bfa675 100644
--- a/gdbserver/linux-s390-low.cc
+++ b/gdbserver/linux-s390-low.cc
@@ -61,6 +61,8 @@ public:
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;
@@ -682,17 +684,17 @@ s390_target::low_breakpoint_at (CORE_ADDR pc)
/* 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;
}
}
@@ -2836,7 +2838,6 @@ s390_emit_ops (void)
}
struct linux_target_ops the_low_target = {
- s390_supports_z_point_type,
NULL,
NULL,
NULL,
diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc
index b88dd46..5723b4f 100644
--- a/gdbserver/linux-sh-low.cc
+++ b/gdbserver/linux-sh-low.cc
@@ -192,7 +192,6 @@ sh_target::low_arch_setup ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-sparc-low.cc b/gdbserver/linux-sparc-low.cc
index c5475d2..46133b5 100644
--- a/gdbserver/linux-sparc-low.cc
+++ b/gdbserver/linux-sparc-low.cc
@@ -341,7 +341,6 @@ sparc_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, NULL, NULL, NULL,
NULL, NULL
};
diff --git a/gdbserver/linux-tic6x-low.cc b/gdbserver/linux-tic6x-low.cc
index dad8a33..30f880a 100644
--- a/gdbserver/linux-tic6x-low.cc
+++ b/gdbserver/linux-tic6x-low.cc
@@ -423,7 +423,6 @@ tic6x_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-tile-low.cc b/gdbserver/linux-tile-low.cc
index 49c18b1..73f3eb9 100644
--- a/gdbserver/linux-tile-low.cc
+++ b/gdbserver/linux-tile-low.cc
@@ -224,7 +224,6 @@ tile_supports_hardware_single_step (void)
struct linux_target_ops the_low_target =
{
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index e7e6d54..d522874 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -108,6 +108,8 @@ public:
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;
@@ -587,8 +589,8 @@ struct x86_dr_low_type x86_dr_low =
/* 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)
{
@@ -596,9 +598,9 @@ x86_supports_z_point_type (char 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;
}
}
@@ -2910,7 +2912,6 @@ x86_get_ipa_tdesc_idx (void)
struct linux_target_ops the_low_target =
{
- x86_supports_z_point_type,
x86_insert_point,
x86_remove_point,
x86_stopped_by_watchpoint,
diff --git a/gdbserver/linux-xtensa-low.cc b/gdbserver/linux-xtensa-low.cc
index 1915226..e1618d1 100644
--- a/gdbserver/linux-xtensa-low.cc
+++ b/gdbserver/linux-xtensa-low.cc
@@ -329,7 +329,6 @@ xtensa_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_z_point_type */
NULL, /* insert_point */
NULL, /* remove_point */
NULL, /* stopped_by_watchpoint */