+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Remote the 'supports_tracepoints' linux target op and let the
+ concrete linux target define it by overriding the op declared in
+ process_stratum_target.
+
+ * linux-low.h (struct linux_target_ops): Remove the op.
+ (class linux_process_target) <supports_tracepoints>: Remove.
+ * linux-low.cc (linux_process_target::supports_tracepoints): Remove.
+ * linux-x86-low.cc (class x86_target) <supports_tracepoints>:
+ Declare.
+ (x86_supports_tracepoints): Turn into...
+ (x86_target::supports_tracepoints): ...this.
+ (the_low_target): Remove the op field.
+ * linux-aarch64-low.cc (class aarch64_target)
+ <supports_tracepoints>: Declare.
+ (aarch64_supports_tracepoints): Turn into...
+ (aarch64_target::supports_tracepoints): ...this.
+ (the_low_target): Remove the op field.
+ * linux-ppc-low.cc (class ppc_target) <supports_tracepoints>:
+ Declare.
+ (ppc_supports_tracepoints): Turn into...
+ (ppc_target::supports_tracepoints): ...this.
+ (the_low_target): Remove the op field.
+ * linux-s390-low.cc (class s390_target) <supports_tracepoints>:
+ Declare.
+ (s390_supports_tracepoints): Turn into...
+ (s390_target::supports_tracepoints): ...this.
+ (the_low_target): Remove the op field.
+ * linux-arm-low.cc (the_low_target): Remove the op field.
+ * linux-bfin-low.cc (the_low_target): Ditto.
+ * linux-crisv32-low.cc (the_low_target): Ditto.
+ * 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-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 'process_qsupported' linux target op and let a concrete
bool supports_z_point_type (char z_type) override;
+ bool supports_tracepoints () override;
+
protected:
void low_arch_setup () override;
return ®s_info_aarch64;
}
-/* Implementation of linux_target_ops method "supports_tracepoints". */
+/* Implementation of target ops method "supports_tracepoints". */
-static int
-aarch64_supports_tracepoints (void)
+bool
+aarch64_target::supports_tracepoints ()
{
if (current_thread == NULL)
- return 1;
+ return true;
else
{
/* We don't support tracepoints on aarch32 now. */
struct linux_target_ops the_low_target =
{
- aarch64_supports_tracepoints,
aarch64_get_thread_area,
aarch64_install_fast_tracepoint_jump_pad,
aarch64_emit_ops,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
return (*the_low_target.get_ipa_tdesc_idx) ();
}
-bool
-linux_process_target::supports_tracepoints ()
-{
- if (*the_low_target.supports_tracepoints == NULL)
- return false;
-
- return (*the_low_target.supports_tracepoints) ();
-}
-
CORE_ADDR
linux_process_target::read_pc (regcache *regcache)
{
struct linux_target_ops
{
- /* Returns true if the low target supports tracepoints. */
- int (*supports_tracepoints) (void);
-
/* Fill ADDRP with the thread area address of LWPID. Returns 0 on
success, -1 on failure. */
int (*get_thread_area) (int lwpid, CORE_ADDR *addrp);
unsigned char *myaddr, unsigned int len) override;
#endif
- bool supports_tracepoints () override;
-
CORE_ADDR read_pc (regcache *regcache) override;
void write_pc (regcache *regcache, CORE_ADDR pc) override;
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
void low_supply_ptrace_register (regcache *regcache, int regno,
const char *buf) override;
+
+ bool supports_tracepoints () override;
+
protected:
void low_arch_setup () override;
}
}
-/* Implementation of linux_target_ops method "supports_tracepoints". */
+/* Implementation of target ops method "supports_tracepoints". */
-static int
-ppc_supports_tracepoints (void)
+bool
+ppc_target::supports_tracepoints ()
{
- return 1;
+ return true;
}
/* Get the thread area address. This is used to recognize which
}
struct linux_target_ops the_low_target = {
- ppc_supports_tracepoints,
ppc_get_thread_area,
ppc_install_fast_tracepoint_jump_pad,
ppc_emit_ops,
bool supports_z_point_type (char z_type) override;
+ bool supports_tracepoints () override;
+
void low_collect_ptrace_register (regcache *regcache, int regno,
char *buf) override;
return &myregs_info;
}
-/* The "supports_tracepoints" linux_target_ops method. */
+/* The "supports_tracepoints" target ops method. */
-static int
-s390_supports_tracepoints (void)
+bool
+s390_target::supports_tracepoints ()
{
- return 1;
+ return true;
}
/* Implementation of linux_target_ops method "get_thread_area". */
}
struct linux_target_ops the_low_target = {
- s390_supports_tracepoints,
s390_get_thread_area,
s390_install_fast_tracepoint_jump_pad,
s390_emit_ops,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
struct linux_target_ops the_low_target =
{
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */
void process_qsupported (char **features, int count) override;
+ bool supports_tracepoints () override;
+
protected:
void low_arch_setup () override;
collect_register_by_name (regcache, "orig_eax", sysno);
}
-static int
-x86_supports_tracepoints (void)
+bool
+x86_target::supports_tracepoints ()
{
- return 1;
+ return true;
}
static void
struct linux_target_ops the_low_target =
{
- x86_supports_tracepoints,
x86_get_thread_area,
x86_install_fast_tracepoint_jump_pad,
x86_emit_ops,
}
struct linux_target_ops the_low_target = {
- NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
NULL, /* install_fast_tracepoint_jump_pad */
NULL, /* emit_ops */