From 8bd200f160af128f9e963490de816b6c98af2d1a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:41:15 -0700 Subject: [PATCH] Add target_ops argument to to_get_trace_status 2014-02-19 Tom Tromey * tracepoint.c (tfile_get_trace_status): Add 'self' argument. * target.h (struct target_ops) : Add argument. (target_get_trace_status): Add argument. * target.c (update_current_target): Update. * remote.c (remote_get_trace_status): Add 'self' argument. (remote_start_remote, remote_can_download_tracepoint): Update. * ctf.c (ctf_get_trace_status): Add 'self' argument. --- gdb/ChangeLog | 11 +++++++++++ gdb/ctf.c | 2 +- gdb/remote.c | 11 ++++++----- gdb/target.c | 2 +- gdb/target.h | 4 ++-- gdb/tracepoint.c | 2 +- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cf502b644ea..b337fa39aea 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2014-02-19 Tom Tromey + + * tracepoint.c (tfile_get_trace_status): Add 'self' argument. + * target.h (struct target_ops) : Add + argument. + (target_get_trace_status): Add argument. + * target.c (update_current_target): Update. + * remote.c (remote_get_trace_status): Add 'self' argument. + (remote_start_remote, remote_can_download_tracepoint): Update. + * ctf.c (ctf_get_trace_status): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. diff --git a/gdb/ctf.c b/gdb/ctf.c index 38c8abb7812..b31c987efb2 100644 --- a/gdb/ctf.c +++ b/gdb/ctf.c @@ -1837,7 +1837,7 @@ ctf_traceframe_info (void) The trace status for a file is that tracing can never be run. */ static int -ctf_get_trace_status (struct trace_status *ts) +ctf_get_trace_status (struct target_ops *self, struct trace_status *ts) { /* Other bits of trace status were collected as part of opening the trace files, so nothing to do here. */ diff --git a/gdb/remote.c b/gdb/remote.c index 4afe062ad07..58a6d4b1e92 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -199,7 +199,8 @@ static ptid_t read_ptid (char *buf, char **obuf); static void remote_set_permissions (void); 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); @@ -3437,7 +3438,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) /* 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; @@ -3606,7 +3607,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) /* 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; @@ -10587,7 +10588,7 @@ remote_can_download_tracepoint (struct target_ops *self) 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; @@ -10722,7 +10723,7 @@ remote_trace_start (struct target_ops *self) } 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; diff --git a/gdb/target.c b/gdb/target.c index cb859b3545c..1d069b73dff 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -873,7 +873,7 @@ update_current_target (void) (void (*) (struct target_ops *)) tcomplain); de_fault (to_get_trace_status, - (int (*) (struct trace_status *)) + (int (*) (struct target_ops *, struct trace_status *)) return_minus_one); de_fault (to_get_tracepoint_status, (void (*) (struct breakpoint *, struct uploaded_tp *)) diff --git a/gdb/target.h b/gdb/target.h index d2e0d80cada..e5397781478 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -787,7 +787,7 @@ struct target_ops void (*to_trace_start) (struct target_ops *); /* Get the current status of a tracing run. */ - int (*to_get_trace_status) (struct trace_status *ts); + int (*to_get_trace_status) (struct target_ops *, struct trace_status *ts); void (*to_get_tracepoint_status) (struct breakpoint *tp, struct uploaded_tp *utp); @@ -1809,7 +1809,7 @@ extern char *target_fileio_read_stralloc (const char *filename); (*current_target.to_trace_set_readonly_regions) (¤t_target) #define target_get_trace_status(ts) \ - (*current_target.to_get_trace_status) (ts) + (*current_target.to_get_trace_status) (¤t_target, ts) #define target_get_tracepoint_status(tp,utp) \ (*current_target.to_get_tracepoint_status) (tp, utp) diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 47b31907564..d20a99e4d50 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -4784,7 +4784,7 @@ tfile_files_info (struct target_ops *t) /* The trace status for a file is that tracing can never be run. */ static int -tfile_get_trace_status (struct trace_status *ts) +tfile_get_trace_status (struct target_ops *self, struct trace_status *ts) { /* Other bits of trace status were collected as part of opening the trace files, so nothing to do here. */ -- 2.30.2