X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fremote.c;h=537221aa436c6489fa3c99e856617fed8191cc38;hb=2117c711ae07700adb57ea5b5ca61e4c32d7e3d2;hp=58a6d4b1e92af11052ad605fdaba43e363a5a3ad;hpb=8bd200f160af128f9e963490de816b6c98af2d1a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/remote.c b/gdb/remote.c index 58a6d4b1e9..537221aa43 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -196,15 +196,17 @@ static void show_remote_protocol_packet_cmd (struct ui_file *file, 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 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); @@ -2890,7 +2892,7 @@ remote_threads_extra_info (struct target_ops *self, struct thread_info *tp) 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 (); @@ -2916,7 +2918,8 @@ remote_static_tracepoint_marker_at (CORE_ADDR addr, } 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; @@ -3355,7 +3358,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) /* 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. @@ -3442,7 +3445,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) { 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); } @@ -3614,7 +3617,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) 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); } @@ -3755,7 +3758,7 @@ remote_serial_open (char *name) permissions. */ void -remote_set_permissions (void) +remote_set_permissions (struct target_ops *self) { struct remote_state *rs = get_remote_state (); @@ -9318,7 +9321,7 @@ remote_get_thread_local_address (struct target_ops *ops, 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) { @@ -9431,7 +9434,7 @@ remote_read_description (struct target_ops *target) /* 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)) { @@ -9450,7 +9453,7 @@ remote_read_description (struct target_ops *target) 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 @@ -10773,7 +10776,7 @@ remote_get_trace_status (struct target_ops *self, struct trace_status *ts) } 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 (); @@ -10820,7 +10823,7 @@ remote_get_tracepoint_status (struct breakpoint *bp, } static void -remote_trace_stop (void) +remote_trace_stop (struct target_ops *self) { putpkt ("QTStop"); remote_get_noisy_reply (&target_buf, &target_buf_size); @@ -10831,7 +10834,8 @@ remote_trace_stop (void) } 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) { @@ -10913,7 +10917,8 @@ remote_trace_find (enum trace_find_type type, int num, } 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; @@ -10937,7 +10942,7 @@ remote_get_trace_state_variable_value (int tsvnum, LONGEST *val) } 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; @@ -10964,7 +10969,8 @@ remote_save_trace_data (const char *filename) 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; @@ -11002,7 +11008,7 @@ remote_get_raw_trace_data (gdb_byte *buf, ULONGEST offset, LONGEST len) } 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 (); @@ -11033,7 +11039,7 @@ remote_core_of_thread (struct target_ops *ops, ptid_t ptid) } 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; @@ -11048,7 +11054,7 @@ remote_set_circular_trace_buffer (int val) } static struct traceframe_info * -remote_traceframe_info (void) +remote_traceframe_info (struct target_ops *self) { char *text; @@ -11078,7 +11084,7 @@ remote_traceframe_info (void) 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; @@ -11107,7 +11113,7 @@ remote_get_min_fast_tracepoint_insn_len (void) } 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) @@ -11139,7 +11145,8 @@ remote_set_trace_buffer_size (LONGEST val) } 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 (); @@ -11185,7 +11192,7 @@ remote_set_trace_notes (const char *user, const char *notes, } 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) { @@ -11207,7 +11214,7 @@ remote_use_agent (int use) } static int -remote_can_use_agent (void) +remote_can_use_agent (struct target_ops *self) { return (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE); } @@ -11236,7 +11243,7 @@ remote_supports_btrace (struct target_ops *self) /* 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]; @@ -11272,7 +11279,8 @@ remote_enable_btrace (ptid_t ptid) /* 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 (); @@ -11304,7 +11312,8 @@ remote_disable_btrace (struct btrace_target_info *tinfo) /* 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); @@ -11313,7 +11322,8 @@ remote_teardown_btrace (struct btrace_target_info *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) { @@ -11360,7 +11370,7 @@ remote_read_btrace (VEC (btrace_block_s) **btrace, } static int -remote_augmented_libraries_svr4_read (void) +remote_augmented_libraries_svr4_read (struct target_ops *self) { struct remote_state *rs = get_remote_state (); @@ -11649,7 +11659,7 @@ remote_new_objfile (struct objfile *objfile) 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; @@ -11670,7 +11680,8 @@ remote_upload_tracepoints (struct uploaded_tp **utpp) } 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;