return 0;
}
-/* Returns true if this target can support fast tracepoints. This
- does not mean that the in-process agent has been loaded in the
- inferior. */
-
-static int
-supports_fast_tracepoints (void)
-{
- return the_low_target.install_fast_tracepoint_jump_pad != NULL;
-}
-
/* True if LWP is stopped in its stepping range. */
static int
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)
{
return 0;
}
-/* Convenience wrapper. Returns information about LWP's fast tracepoint
- collection status. */
-
-static fast_tpoint_collect_result
-linux_fast_tracepoint_collecting (struct lwp_info *lwp,
- struct fast_tpoint_collect_status *status)
+fast_tpoint_collect_result
+linux_process_target::linux_fast_tracepoint_collecting
+ (lwp_info *lwp, fast_tpoint_collect_status *status)
{
CORE_ADDR thread_area;
struct thread_info *thread = get_lwp_thread (lwp);
- if (the_low_target.get_thread_area == NULL)
- return fast_tpoint_collect_result::not_collecting;
-
/* Get the thread area address. This is used to recognize which
thread is which when tracing with the in-process agent library.
We don't read anything from the address, and treat it as opaque;
it's the address itself that we assume is unique per-thread. */
- if ((*the_low_target.get_thread_area) (lwpid_of (thread), &thread_area) == -1)
+ if (low_get_thread_area (lwpid_of (thread), &thread_area) == -1)
return fast_tpoint_collect_result::not_collecting;
return fast_tracepoint_collecting (thread_area, lwp->stop_pc, status);
}
+int
+linux_process_target::low_get_thread_area (int lwpid, CORE_ADDR *addrp)
+{
+ return -1;
+}
+
bool
linux_process_target::maybe_move_out_of_jump_pad (lwp_info *lwp, int *wstat)
{
});
}
-static bool stuck_in_jump_pad_callback (thread_info *thread);
static bool lwp_running (thread_info *thread);
/* Stabilize threads (move out of jump pads).
void
linux_process_target::stabilize_threads ()
{
- thread_info *thread_stuck = find_thread (stuck_in_jump_pad_callback);
+ thread_info *thread_stuck = find_thread ([this] (thread_info *thread)
+ {
+ return stuck_in_jump_pad (thread);
+ });
if (thread_stuck != NULL)
{
if (debug_threads)
{
- thread_stuck = find_thread (stuck_in_jump_pad_callback);
+ thread_stuck = find_thread ([this] (thread_info *thread)
+ {
+ return stuck_in_jump_pad (thread);
+ });
if (thread_stuck != NULL)
debug_printf ("couldn't stabilize, LWP %ld got stuck in jump pad\n",
}
}
-/* Returns true if THREAD is stopped in a jump pad, and we can't
- move it out, because we need to report the stop event to GDB. For
- example, if the user puts a breakpoint in the jump pad, it's
- because she wants to debug it. */
-
-static bool
-stuck_in_jump_pad_callback (thread_info *thread)
+bool
+linux_process_target::stuck_in_jump_pad (thread_info *thread)
{
struct lwp_info *lwp = get_thread_lwp (thread);
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
{
if (supports_software_single_step ())
return true;
- if (*the_low_target.supports_range_stepping == NULL)
- return false;
- return (*the_low_target.supports_range_stepping) ();
+ return low_supports_range_stepping ();
+}
+
+bool
+linux_process_target::low_supports_range_stepping ()
+{
+ return false;
}
bool
}
#endif /* defined PT_GETDSBT || defined PTRACE_GETFDPIC */
-void
-linux_process_target::process_qsupported (char **features, int count)
-{
- if (the_low_target.process_qsupported != NULL)
- the_low_target.process_qsupported (features, count);
-}
-
bool
linux_process_target::supports_catch_syscall ()
{
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)
{
target_unpause_all (true);
}
-bool
-linux_process_target::supports_fast_tracepoints ()
-{
- return the_low_target.install_fast_tracepoint_jump_pad != nullptr;
-}
-
-int
-linux_process_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)
-{
- return (*the_low_target.install_fast_tracepoint_jump_pad)
- (tpoint, tpaddr, collector, lockaddr, orig_size,
- jump_entry, trampoline, trampoline_size,
- jjump_pad_insn, jjump_pad_insn_size,
- adjusted_insn_addr, adjusted_insn_addr_end,
- err);
-}
-
-emit_ops *
-linux_process_target::emit_ops ()
-{
- if (the_low_target.emit_ops != NULL)
- return (*the_low_target.emit_ops) ();
- else
- return NULL;
-}
-
-int
-linux_process_target::get_min_fast_tracepoint_insn_len ()
-{
- return (*the_low_target.get_min_fast_tracepoint_insn_len) ();
-}
-
/* Extract &phdr and num_phdr in the inferior. Return 0 on success. */
static int