{
public:
- /* Update all the target description of all processes; a new GDB
- connected, and it may or not support xml target descriptions. */
- void update_xmltarget ();
-
const regs_info *get_regs_info () override;
const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
bool supports_z_point_type (char z_type) override;
+ void process_qsupported (char **features, int count) override;
+
+ bool supports_tracepoints () override;
+
+ bool supports_fast_tracepoints () override;
+
+ int install_fast_tracepoint_jump_pad
+ (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
+ CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
+ CORE_ADDR *trampoline, ULONGEST *trampoline_size,
+ unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
+ CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
+ char *err) override;
+
+ int get_min_fast_tracepoint_insn_len () override;
+
+ struct emit_ops *emit_ops () override;
+
+ int get_ipa_tdesc_idx () override;
+
protected:
void low_arch_setup () override;
/* Need to fix up i386 siginfo if host is amd64. */
bool low_siginfo_fixup (siginfo_t *native, gdb_byte *inf,
int direction) override;
+
+ arch_process_info *low_new_process () override;
+
+ void low_delete_process (arch_process_info *info) override;
+
+ void low_new_thread (lwp_info *) override;
+
+ void low_delete_thread (arch_lwp_info *) override;
+
+ void low_new_fork (process_info *parent, process_info *child) override;
+
+ void low_prepare_to_resume (lwp_info *lwp) override;
+
+ int low_get_thread_area (int lwpid, CORE_ADDR *addrp) override;
+
+ bool low_supports_range_stepping () override;
+
+ bool low_supports_catch_syscall () override;
+
+ void low_get_syscall_trapinfo (regcache *regcache, int *sysno) override;
+
+private:
+
+ /* Update all the target description of all processes; a new GDB
+ connected, and it may or not support xml target descriptions. */
+ void update_xmltarget ();
};
/* The singleton target ops object. */
don't read anything from the address, and treat it as opaque; it's
the address itself that we assume is unique per-thread. */
-static int
-x86_get_thread_area (int lwpid, CORE_ADDR *addr)
+int
+x86_target::low_get_thread_area (int lwpid, CORE_ADDR *addr)
{
#ifdef __x86_64__
int use_64bit = is_64bit_tdesc ();
\f
/* Called when a new process is created. */
-static struct arch_process_info *
-x86_linux_new_process (void)
+arch_process_info *
+x86_target::low_new_process ()
{
struct arch_process_info *info = XCNEW (struct arch_process_info);
/* Called when a process is being deleted. */
-static void
-x86_linux_delete_process (struct arch_process_info *info)
+void
+x86_target::low_delete_process (arch_process_info *info)
{
xfree (info);
}
-/* Target routine for linux_new_fork. */
+void
+x86_target::low_new_thread (lwp_info *lwp)
+{
+ /* This comes from nat/. */
+ x86_linux_new_thread (lwp);
+}
-static void
-x86_linux_new_fork (struct process_info *parent, struct process_info *child)
+void
+x86_target::low_delete_thread (arch_lwp_info *alwp)
+{
+ /* This comes from nat/. */
+ x86_linux_delete_thread (alwp);
+}
+
+/* Target routine for new_fork. */
+
+void
+x86_target::low_new_fork (process_info *parent, process_info *child)
{
/* These are allocated by linux_add_process. */
gdb_assert (parent->priv != NULL
*child->priv->arch_private = *parent->priv->arch_private;
}
+void
+x86_target::low_prepare_to_resume (lwp_info *lwp)
+{
+ /* This comes from nat/. */
+ x86_linux_prepare_to_resume (lwp);
+}
+
/* See nat/x86-dregs.h. */
struct x86_debug_reg_state *
/* Process qSupported query, "xmlRegisters=". Update the buffer size for
PTRACE_GETREGSET. */
-static void
-x86_linux_process_qsupported (char **features, int count)
+void
+x86_target::process_qsupported (char **features, int count)
{
int i;
free (copy);
}
}
- the_x86_target.update_xmltarget ();
+ update_xmltarget ();
}
/* Common for x86/x86-64. */
current_process ()->tdesc = x86_linux_read_description ();
}
+bool
+x86_target::low_supports_catch_syscall ()
+{
+ return true;
+}
+
/* Fill *SYSNO and *SYSRET with the syscall nr trapped and the syscall return
code. This should only be called if LWP got a SYSCALL_SIGTRAP. */
-static void
-x86_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
+void
+x86_target::low_get_syscall_trapinfo (regcache *regcache, int *sysno)
{
int use_64bit = register_size (regcache->tdesc, 0) == 8;
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
return 0;
}
-static int
-x86_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr,
- CORE_ADDR collector,
- CORE_ADDR lockaddr,
- ULONGEST orig_size,
- CORE_ADDR *jump_entry,
- CORE_ADDR *trampoline,
- ULONGEST *trampoline_size,
- unsigned char *jjump_pad_insn,
- ULONGEST *jjump_pad_insn_size,
- CORE_ADDR *adjusted_insn_addr,
- CORE_ADDR *adjusted_insn_addr_end,
- char *err)
+bool
+x86_target::supports_fast_tracepoints ()
+{
+ return true;
+}
+
+int
+x86_target::install_fast_tracepoint_jump_pad (CORE_ADDR tpoint,
+ CORE_ADDR tpaddr,
+ CORE_ADDR collector,
+ CORE_ADDR lockaddr,
+ ULONGEST orig_size,
+ CORE_ADDR *jump_entry,
+ CORE_ADDR *trampoline,
+ ULONGEST *trampoline_size,
+ unsigned char *jjump_pad_insn,
+ ULONGEST *jjump_pad_insn_size,
+ CORE_ADDR *adjusted_insn_addr,
+ CORE_ADDR *adjusted_insn_addr_end,
+ char *err)
{
#ifdef __x86_64__
if (is_64bit_tdesc ())
/* Return the minimum instruction length for fast tracepoints on x86/x86-64
architectures. */
-static int
-x86_get_min_fast_tracepoint_insn_len (void)
+int
+x86_target::get_min_fast_tracepoint_insn_len ()
{
static int warned_about_fast_tracepoints = 0;
};
-static struct emit_ops *
-x86_emit_ops (void)
+emit_ops *
+x86_target::emit_ops ()
{
#ifdef __x86_64__
if (is_64bit_tdesc ())
return x86_breakpoint;
}
-static int
-x86_supports_range_stepping (void)
-{
- return 1;
-}
-
-/* Implementation of linux_target_ops method "supports_hardware_single_step".
- */
-
-static int
-x86_supports_hardware_single_step (void)
+bool
+x86_target::low_supports_range_stepping ()
{
- return 1;
+ return true;
}
-static int
-x86_get_ipa_tdesc_idx (void)
+int
+x86_target::get_ipa_tdesc_idx ()
{
struct regcache *regcache = get_thread_regcache (current_thread, 0);
const struct target_desc *tdesc = regcache->tdesc;
return i386_get_ipa_tdesc_idx (tdesc);
}
-/* This is initialized assuming an amd64 target.
- x86_arch_setup will correct it for i386 or amd64 targets. */
-
-struct linux_target_ops the_low_target =
-{
- x86_linux_new_process,
- x86_linux_delete_process,
- x86_linux_new_thread,
- x86_linux_delete_thread,
- x86_linux_new_fork,
- x86_linux_prepare_to_resume,
- x86_linux_process_qsupported,
- x86_supports_tracepoints,
- x86_get_thread_area,
- x86_install_fast_tracepoint_jump_pad,
- x86_emit_ops,
- x86_get_min_fast_tracepoint_insn_len,
- x86_supports_range_stepping,
- x86_supports_hardware_single_step,
- x86_get_syscall_trapinfo,
- x86_get_ipa_tdesc_idx,
-};
-
/* The linux target ops object. */
linux_process_target *the_linux_target = &the_x86_target;