+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Turn the 'prepare_to_resume' linux target op into a method of
+ linux_process_target.
+
+ * linux-low.h (struct linux_target_ops): Remove the op.
+ (class linux_process_target) <low_prepare_to_resume>: Declare.
+ * linux-low.cc (linux_process_target::low_prepare_to_resume):
+ Define.
+
+ Update the callers below:
+
+ (linux_process_target::resume_one_lwp_throw)
+ (linux_process_target::low_prepare_to_resume)
+
+ * linux-x86-low.cc (class x86_target) <low_prepare_to_resume>:
+ Declare.
+ (x86_target::low_prepare_to_resume): Define.
+ (the_low_target): Remove the op field.
+ * linux-aarch64-low.cc (class aarch64_target)
+ <low_prepare_to_resume>: Declare.
+ (aarch64_target::low_prepare_to_resume): Define.
+ (the_low_target): Remove the op field.
+ * linux-arm-low.cc (class arm_target) <low_prepare_to_resume>:
+ Declare.
+ (arm_prepare_to_resume): Turn into...
+ (arm_target::low_prepare_to_resume): ...this.
+ (the_low_target): Remove the op field.
+ * linux-mips-low.cc (class mips_target) <low_prepare_to_resume>:
+ Declare.
+ (mips_linux_prepare_to_resume): Turn into...
+ (mips_target::low_prepare_to_resume): ...this.
+ (the_low_target): Remove the op field.
+ * linux-bfin-low.cc (the_low_target): Remove the op field.
+ * 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-ppc-low.cc (the_low_target): Ditto.
+ * linux-s390-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>
Turn the 'new_process', 'delete_process', 'new_thread',
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;
};
/* The singleton target ops object. */
"is not implemented by the target");
}
+void
+aarch64_target::low_prepare_to_resume (lwp_info *lwp)
+{
+ aarch64_linux_prepare_to_resume (lwp);
+}
+
/* Per-process arch-specific data we want to keep. */
struct arch_process_info
struct linux_target_ops the_low_target =
{
- aarch64_linux_prepare_to_resume,
NULL, /* process_qsupported */
aarch64_supports_tracepoints,
aarch64_get_thread_area,
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;
};
/* The singleton target ops object. */
/* Called when resuming a thread.
If the debug regs have changed, update the thread's copies. */
-static void
-arm_prepare_to_resume (struct lwp_info *lwp)
+void
+arm_target::low_prepare_to_resume (lwp_info *lwp)
{
struct thread_info *thread = get_lwp_thread (lwp);
int pid = lwpid_of (thread);
}
struct linux_target_ops the_low_target = {
- arm_prepare_to_resume,
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
regcache_invalidate_thread (thread);
/* Finally, let it resume. */
- if (the_low_target.prepare_to_resume != NULL)
- the_low_target.prepare_to_resume (lwp);
+ low_prepare_to_resume (lwp);
}
catch (const gdb_exception_error &ex)
{
lwpid_of (thread), step ? "step" : "continue", signal,
lwp->stop_expected ? "expected" : "not expected");
- if (the_low_target.prepare_to_resume != NULL)
- the_low_target.prepare_to_resume (lwp);
+ low_prepare_to_resume (lwp);
regcache_invalidate_thread (thread);
errno = 0;
lwp->stop_reason = TARGET_STOPPED_BY_NO_REASON;
}
+void
+linux_process_target::low_prepare_to_resume (lwp_info *lwp)
+{
+ /* Nop. */
+}
+
/* Called when we try to resume a stopped LWP and that errors out. If
the LWP is no longer in ptrace-stopped state (meaning it's zombie,
or about to become), discard the error, clear any pending status
struct linux_target_ops
{
- /* Hook to call prior to resuming a thread. */
- void (*prepare_to_resume) (struct lwp_info *);
-
/* Hook to support target specific qSupported. */
void (*process_qsupported) (char **, int count);
/* Hook to call, if any, when a new fork is attached. */
virtual void low_new_fork (process_info *parent, process_info *child);
+ /* Hook to call prior to resuming a thread. */
+ virtual void low_prepare_to_resume (lwp_info *lwp);
+
/* 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, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
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;
};
/* The singleton target ops object. */
child_private->watch_mirror = parent_private->watch_mirror;
}
-/* This is the implementation of linux_target_ops method
- prepare_to_resume. If the watch regs have changed, update the
+/* This is the implementation of linux target ops method
+ low_prepare_to_resume. If the watch regs have changed, update the
thread's copies. */
-static void
-mips_linux_prepare_to_resume (struct lwp_info *lwp)
+void
+mips_target::low_prepare_to_resume (lwp_info *lwp)
{
ptid_t ptid = ptid_of (get_lwp_thread (lwp));
struct process_info *proc = find_process_pid (ptid.pid ());
}
struct linux_target_ops the_low_target = {
- mips_linux_prepare_to_resume
};
/* The linux target ops object. */
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
ppc_supports_tracepoints,
ppc_get_thread_area,
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
s390_supports_tracepoints,
s390_get_thread_area,
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
struct linux_target_ops the_low_target =
{
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */
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;
};
/* The singleton target ops object. */
*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 *
struct linux_target_ops the_low_target =
{
- x86_linux_prepare_to_resume,
x86_linux_process_qsupported,
x86_supports_tracepoints,
x86_get_thread_area,
}
struct linux_target_ops the_low_target = {
- NULL, /* prepare_to_resume */
NULL, /* process_qsupported */
NULL, /* supports_tracepoints */
NULL, /* get_thread_area */