static char *write_ptid (char *buf, const char *endbuf, ptid_t ptid);
static ptid_t read_ptid (char *buf, char **obuf);
-static void remote_set_permissions (void);
+static void remote_set_permissions (struct target_ops *self);
struct remote_state;
-static int remote_get_trace_status (struct trace_status *ts);
+static int remote_get_trace_status (struct target_ops *self,
+ struct trace_status *ts);
-static int remote_upload_tracepoints (struct uploaded_tp **utpp);
+static int remote_upload_tracepoints (struct target_ops *self,
+ struct uploaded_tp **utpp);
-static int remote_upload_trace_state_variables (struct uploaded_tsv **utsvp);
+static int remote_upload_trace_state_variables (struct target_ops *self,
+ struct uploaded_tsv **utsvp);
static void remote_query_supported (void);
\f
static int
-remote_static_tracepoint_marker_at (CORE_ADDR addr,
+remote_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR addr,
struct static_tracepoint_marker *marker)
{
struct remote_state *rs = get_remote_state ();
}
static VEC(static_tracepoint_marker_p) *
-remote_static_tracepoint_markers_by_strid (const char *strid)
+remote_static_tracepoint_markers_by_strid (struct target_ops *self,
+ const char *strid)
{
struct remote_state *rs = get_remote_state ();
VEC(static_tracepoint_marker_p) *markers = NULL;
/* If the stub wants to get a QAllow, compose one and send it. */
if (remote_protocol_packets[PACKET_QAllow].support != PACKET_DISABLE)
- remote_set_permissions ();
+ remote_set_permissions (target);
/* Next, we possibly activate noack mode.
/* Upload TSVs regardless of whether the target is running or not. The
remote stub, such as GDBserver, may have some predefined or builtin
TSVs, even if the target is not running. */
- if (remote_get_trace_status (current_trace_status ()) != -1)
+ if (remote_get_trace_status (target, current_trace_status ()) != -1)
{
struct uploaded_tsv *uploaded_tsvs = NULL;
- remote_upload_trace_state_variables (&uploaded_tsvs);
+ remote_upload_trace_state_variables (target, &uploaded_tsvs);
merge_uploaded_trace_state_variables (&uploaded_tsvs);
}
/* Possibly the target has been engaged in a trace run started
previously; find out where things are at. */
- if (remote_get_trace_status (current_trace_status ()) != -1)
+ if (remote_get_trace_status (target, current_trace_status ()) != -1)
{
struct uploaded_tp *uploaded_tps = NULL;
if (current_trace_status ()->running)
printf_filtered (_("Trace is already running on the target.\n"));
- remote_upload_tracepoints (&uploaded_tps);
+ remote_upload_tracepoints (target, &uploaded_tps);
merge_uploaded_tracepoints (&uploaded_tps);
}
permissions. */
void
-remote_set_permissions (void)
+remote_set_permissions (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
Returns 1 if ptid is found and thread_local_base is non zero. */
static int
-remote_get_tib_address (ptid_t ptid, CORE_ADDR *addr)
+remote_get_tib_address (struct target_ops *self, ptid_t ptid, CORE_ADDR *addr)
{
if (remote_protocol_packets[PACKET_qGetTIBAddr].support != PACKET_DISABLE)
{
/* Do not try this during initial connection, when we do not know
whether there is a running but stopped thread. */
if (!target_has_execution || ptid_equal (inferior_ptid, null_ptid))
- return NULL;
+ return target->beneath->to_read_description (target->beneath);
if (!VEC_empty (remote_g_packet_guess_s, data->guesses))
{
an architecture, but it's too tricky to do safely. */
}
- return NULL;
+ return target->beneath->to_read_description (target->beneath);
}
/* Remote file transfer support. This is host-initiated I/O, not
return 0;
ts = current_trace_status ();
- status = remote_get_trace_status (ts);
+ status = remote_get_trace_status (self, ts);
if (status == -1 || !ts->running_known || !ts->running)
return 0;
}
static int
-remote_get_trace_status (struct trace_status *ts)
+remote_get_trace_status (struct target_ops *self, struct trace_status *ts)
{
/* Initialize it just to avoid a GCC false warning. */
char *p = NULL;
}
static void
-remote_get_tracepoint_status (struct breakpoint *bp,
+remote_get_tracepoint_status (struct target_ops *self, struct breakpoint *bp,
struct uploaded_tp *utp)
{
struct remote_state *rs = get_remote_state ();
}
static void
-remote_trace_stop (void)
+remote_trace_stop (struct target_ops *self)
{
putpkt ("QTStop");
remote_get_noisy_reply (&target_buf, &target_buf_size);
}
static int
-remote_trace_find (enum trace_find_type type, int num,
+remote_trace_find (struct target_ops *self,
+ enum trace_find_type type, int num,
CORE_ADDR addr1, CORE_ADDR addr2,
int *tpp)
{
}
static int
-remote_get_trace_state_variable_value (int tsvnum, LONGEST *val)
+remote_get_trace_state_variable_value (struct target_ops *self,
+ int tsvnum, LONGEST *val)
{
struct remote_state *rs = get_remote_state ();
char *reply;
}
static int
-remote_save_trace_data (const char *filename)
+remote_save_trace_data (struct target_ops *self, const char *filename)
{
struct remote_state *rs = get_remote_state ();
char *p, *reply;
not be unhappy if we don't get as much as we ask for. */
static LONGEST
-remote_get_raw_trace_data (gdb_byte *buf, ULONGEST offset, LONGEST len)
+remote_get_raw_trace_data (struct target_ops *self,
+ gdb_byte *buf, ULONGEST offset, LONGEST len)
{
struct remote_state *rs = get_remote_state ();
char *reply;
}
static void
-remote_set_disconnected_tracing (int val)
+remote_set_disconnected_tracing (struct target_ops *self, int val)
{
struct remote_state *rs = get_remote_state ();
}
static void
-remote_set_circular_trace_buffer (int val)
+remote_set_circular_trace_buffer (struct target_ops *self, int val)
{
struct remote_state *rs = get_remote_state ();
char *reply;
}
static struct traceframe_info *
-remote_traceframe_info (void)
+remote_traceframe_info (struct target_ops *self)
{
char *text;
length is unknown. */
static int
-remote_get_min_fast_tracepoint_insn_len (void)
+remote_get_min_fast_tracepoint_insn_len (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
char *reply;
}
static void
-remote_set_trace_buffer_size (LONGEST val)
+remote_set_trace_buffer_size (struct target_ops *self, LONGEST val)
{
if (remote_protocol_packets[PACKET_QTBuffer_size].support
!= PACKET_DISABLE)
}
static int
-remote_set_trace_notes (const char *user, const char *notes,
+remote_set_trace_notes (struct target_ops *self,
+ const char *user, const char *notes,
const char *stop_notes)
{
struct remote_state *rs = get_remote_state ();
}
static int
-remote_use_agent (int use)
+remote_use_agent (struct target_ops *self, int use)
{
if (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE)
{
}
static int
-remote_can_use_agent (void)
+remote_can_use_agent (struct target_ops *self)
{
return (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE);
}
/* Enable branch tracing. */
static struct btrace_target_info *
-remote_enable_btrace (ptid_t ptid)
+remote_enable_btrace (struct target_ops *self, ptid_t ptid)
{
struct btrace_target_info *tinfo = NULL;
struct packet_config *packet = &remote_protocol_packets[PACKET_Qbtrace_bts];
/* Disable branch tracing. */
static void
-remote_disable_btrace (struct btrace_target_info *tinfo)
+remote_disable_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
struct packet_config *packet = &remote_protocol_packets[PACKET_Qbtrace_off];
struct remote_state *rs = get_remote_state ();
/* Teardown branch tracing. */
static void
-remote_teardown_btrace (struct btrace_target_info *tinfo)
+remote_teardown_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
/* We must not talk to the target during teardown. */
xfree (tinfo);
/* Read the branch trace. */
static enum btrace_error
-remote_read_btrace (VEC (btrace_block_s) **btrace,
+remote_read_btrace (struct target_ops *self,
+ VEC (btrace_block_s) **btrace,
struct btrace_target_info *tinfo,
enum btrace_read_type type)
{
}
static int
-remote_augmented_libraries_svr4_read (void)
+remote_augmented_libraries_svr4_read (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
collection. */
static int
-remote_upload_tracepoints (struct uploaded_tp **utpp)
+remote_upload_tracepoints (struct target_ops *self, struct uploaded_tp **utpp)
{
struct remote_state *rs = get_remote_state ();
char *p;
}
static int
-remote_upload_trace_state_variables (struct uploaded_tsv **utsvp)
+remote_upload_trace_state_variables (struct target_ops *self,
+ struct uploaded_tsv **utsvp)
{
struct remote_state *rs = get_remote_state ();
char *p;