From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [RFC 24/32] convert to_disable_tracepoint
Date: Mon, 13 Jan 2014 19:13:00 -0000 [thread overview]
Message-ID: <1389640367-5571-25-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1389640367-5571-1-git-send-email-tromey@redhat.com>
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_disable_tracepoint.
* target.h (struct target_ops) <to_disable_tracepoint>: Use
TARGET_DEFAULT_NORETURN.
convert to_trace_set_readonly_regions
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_set_readonly_regions.
* target.h (struct target_ops) <to_trace_set_readonly_regions>:
Use TARGET_DEFAULT_NORETURN.
convert to_trace_start
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_start.
* target.h (struct target_ops) <to_trace_start>: Use
TARGET_DEFAULT_NORETURN.
convert to_get_trace_status
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_trace_status.
* target.h (struct target_ops) <to_get_trace_status>: Use
TARGET_DEFAULT_RETURN.
convert to_get_tracepoint_status
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_tracepoint_status.
* target.h (struct target_ops) <to_get_tracepoint_status>: Use
TARGET_DEFAULT_NORETURN.
convert to_trace_stop
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_stop.
* target.h (struct target_ops) <to_trace_stop>: Use
TARGET_DEFAULT_NORETURN.
convert to_trace_find
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_find.
* target.h (struct target_ops): Use TARGET_DEFAULT_RETURN.
convert to_get_trace_state_variable_value
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_trace_state_variable_value.
* target.h (struct target_ops)
<to_get_trace_state_variable_value>: Use TARGET_DEFAULT_RETURN.
convert to_save_trace_data
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_save_trace_data.
* target.h (struct target_ops) <to_save_trace_data>: Use
TARGET_DEFAULT_NORETURN.
convert to_upload_tracepoints
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c : Rebuild.
* target.c (update_current_target): Don't inherit or default
to_upload_tracepoints.
* target.h (struct target_ops) <to_upload_tracepoints>: Use
TARGET_DEFAULT_RETURN.
---
gdb/ChangeLog | 79 ++++++++++++++++++++++++
gdb/target-delegates.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++
gdb/target.c | 52 ++++------------
gdb/target.h | 30 ++++++----
4 files changed, 269 insertions(+), 52 deletions(-)
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 53fabb1..ddcc89c 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -702,6 +702,136 @@ tdefault_enable_tracepoint (struct target_ops *self, struct bp_location *arg1)
tcomplain ();
}
+static void
+delegate_disable_tracepoint (struct target_ops *self, struct bp_location *arg1)
+{
+ self = self->beneath;
+ self->to_disable_tracepoint (self, arg1);
+}
+
+static void
+tdefault_disable_tracepoint (struct target_ops *self, struct bp_location *arg1)
+{
+ tcomplain ();
+}
+
+static void
+delegate_trace_set_readonly_regions (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_trace_set_readonly_regions (self);
+}
+
+static void
+tdefault_trace_set_readonly_regions (struct target_ops *self)
+{
+ tcomplain ();
+}
+
+static void
+delegate_trace_start (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_trace_start (self);
+}
+
+static void
+tdefault_trace_start (struct target_ops *self)
+{
+ tcomplain ();
+}
+
+static int
+delegate_get_trace_status (struct target_ops *self, struct trace_status *arg1)
+{
+ self = self->beneath;
+ return self->to_get_trace_status (self, arg1);
+}
+
+static int
+tdefault_get_trace_status (struct target_ops *self, struct trace_status *arg1)
+{
+ return -1;
+}
+
+static void
+delegate_get_tracepoint_status (struct target_ops *self, struct breakpoint *arg1, struct uploaded_tp *arg2)
+{
+ self = self->beneath;
+ self->to_get_tracepoint_status (self, arg1, arg2);
+}
+
+static void
+tdefault_get_tracepoint_status (struct target_ops *self, struct breakpoint *arg1, struct uploaded_tp *arg2)
+{
+ tcomplain ();
+}
+
+static void
+delegate_trace_stop (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_trace_stop (self);
+}
+
+static void
+tdefault_trace_stop (struct target_ops *self)
+{
+ tcomplain ();
+}
+
+static int
+delegate_trace_find (struct target_ops *self, enum trace_find_type arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5)
+{
+ self = self->beneath;
+ return self->to_trace_find (self, arg1, arg2, arg3, arg4, arg5);
+}
+
+static int
+tdefault_trace_find (struct target_ops *self, enum trace_find_type arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5)
+{
+ return -1;
+}
+
+static int
+delegate_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2)
+{
+ self = self->beneath;
+ return self->to_get_trace_state_variable_value (self, arg1, arg2);
+}
+
+static int
+tdefault_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2)
+{
+ return 0;
+}
+
+static int
+delegate_save_trace_data (struct target_ops *self, const char *arg1)
+{
+ self = self->beneath;
+ return self->to_save_trace_data (self, arg1);
+}
+
+static int
+tdefault_save_trace_data (struct target_ops *self, const char *arg1)
+{
+ tcomplain ();
+}
+
+static int
+delegate_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1)
+{
+ self = self->beneath;
+ return self->to_upload_tracepoints (self, arg1);
+}
+
+static int
+tdefault_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1)
+{
+ return 0;
+}
+
static int
delegate_supports_btrace (struct target_ops *self)
{
@@ -840,6 +970,26 @@ install_delegators (struct target_ops *ops)
ops->to_download_trace_state_variable = delegate_download_trace_state_variable;
if (ops->to_enable_tracepoint == NULL)
ops->to_enable_tracepoint = delegate_enable_tracepoint;
+ if (ops->to_disable_tracepoint == NULL)
+ ops->to_disable_tracepoint = delegate_disable_tracepoint;
+ if (ops->to_trace_set_readonly_regions == NULL)
+ ops->to_trace_set_readonly_regions = delegate_trace_set_readonly_regions;
+ if (ops->to_trace_start == NULL)
+ ops->to_trace_start = delegate_trace_start;
+ if (ops->to_get_trace_status == NULL)
+ ops->to_get_trace_status = delegate_get_trace_status;
+ if (ops->to_get_tracepoint_status == NULL)
+ ops->to_get_tracepoint_status = delegate_get_tracepoint_status;
+ if (ops->to_trace_stop == NULL)
+ ops->to_trace_stop = delegate_trace_stop;
+ if (ops->to_trace_find == NULL)
+ ops->to_trace_find = delegate_trace_find;
+ if (ops->to_get_trace_state_variable_value == NULL)
+ ops->to_get_trace_state_variable_value = delegate_get_trace_state_variable_value;
+ if (ops->to_save_trace_data == NULL)
+ ops->to_save_trace_data = delegate_save_trace_data;
+ if (ops->to_upload_tracepoints == NULL)
+ ops->to_upload_tracepoints = delegate_upload_tracepoints;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
}
@@ -908,5 +1058,15 @@ install_dummy_methods (struct target_ops *ops)
ops->to_can_download_tracepoint = tdefault_can_download_tracepoint;
ops->to_download_trace_state_variable = tdefault_download_trace_state_variable;
ops->to_enable_tracepoint = tdefault_enable_tracepoint;
+ ops->to_disable_tracepoint = tdefault_disable_tracepoint;
+ ops->to_trace_set_readonly_regions = tdefault_trace_set_readonly_regions;
+ ops->to_trace_start = tdefault_trace_start;
+ ops->to_get_trace_status = tdefault_get_trace_status;
+ ops->to_get_tracepoint_status = tdefault_get_tracepoint_status;
+ ops->to_trace_stop = tdefault_trace_stop;
+ ops->to_trace_find = tdefault_trace_find;
+ ops->to_get_trace_state_variable_value = tdefault_get_trace_state_variable_value;
+ ops->to_save_trace_data = tdefault_save_trace_data;
+ ops->to_upload_tracepoints = tdefault_upload_tracepoints;
ops->to_supports_btrace = tdefault_supports_btrace;
}
diff --git a/gdb/target.c b/gdb/target.c
index 83dfee7..90e2709 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -689,16 +689,16 @@ update_current_target (void)
/* Do not inherit to_can_download_tracepoint. */
/* Do not inherit to_download_trace_state_variable. */
/* Do not inherit to_enable_tracepoint. */
- INHERIT (to_disable_tracepoint, t);
- INHERIT (to_trace_set_readonly_regions, t);
- INHERIT (to_trace_start, t);
- INHERIT (to_get_trace_status, t);
- INHERIT (to_get_tracepoint_status, t);
- INHERIT (to_trace_stop, t);
- INHERIT (to_trace_find, t);
- INHERIT (to_get_trace_state_variable_value, t);
- INHERIT (to_save_trace_data, t);
- INHERIT (to_upload_tracepoints, t);
+ /* Do not inherit to_disable_tracepoint. */
+ /* Do not inherit to_trace_set_readonly_regions. */
+ /* Do not inherit to_trace_start. */
+ /* Do not inherit to_get_trace_status. */
+ /* Do not inherit to_get_tracepoint_status. */
+ /* Do not inherit to_trace_stop. */
+ /* Do not inherit to_trace_find. */
+ /* Do not inherit to_get_trace_state_variable_value. */
+ /* Do not inherit to_save_trace_data. */
+ /* Do not inherit to_upload_tracepoints. */
INHERIT (to_upload_trace_state_variables, t);
INHERIT (to_get_raw_trace_data, t);
INHERIT (to_get_min_fast_tracepoint_insn_len, t);
@@ -748,38 +748,6 @@ update_current_target (void)
(void (*) (struct target_ops *, ptid_t))
target_ignore);
current_target.to_read_description = NULL;
- de_fault (to_disable_tracepoint,
- (void (*) (struct target_ops *, struct bp_location *))
- tcomplain);
- de_fault (to_trace_set_readonly_regions,
- (void (*) (struct target_ops *))
- tcomplain);
- de_fault (to_trace_start,
- (void (*) (struct target_ops *))
- tcomplain);
- de_fault (to_get_trace_status,
- (int (*) (struct target_ops *, struct trace_status *))
- return_minus_one);
- de_fault (to_get_tracepoint_status,
- (void (*) (struct target_ops *, struct breakpoint *,
- struct uploaded_tp *))
- tcomplain);
- de_fault (to_trace_stop,
- (void (*) (struct target_ops *))
- tcomplain);
- de_fault (to_trace_find,
- (int (*) (struct target_ops *,
- enum trace_find_type, int, CORE_ADDR, CORE_ADDR, int *))
- return_minus_one);
- de_fault (to_get_trace_state_variable_value,
- (int (*) (struct target_ops *, int, LONGEST *))
- return_zero);
- de_fault (to_save_trace_data,
- (int (*) (struct target_ops *, const char *))
- tcomplain);
- de_fault (to_upload_tracepoints,
- (int (*) (struct target_ops *, struct uploaded_tp **))
- return_zero);
de_fault (to_upload_trace_state_variables,
(int (*) (struct target_ops *, struct uploaded_tsv **))
return_zero);
diff --git a/gdb/target.h b/gdb/target.h
index 4a5573d..dfaad80 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -808,25 +808,31 @@ struct target_ops
/* Disable a tracepoint on the target. */
void (*to_disable_tracepoint) (struct target_ops *,
- struct bp_location *location);
+ struct bp_location *location)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Inform the target info of memory regions that are readonly
(such as text sections), and so it should return data from
those rather than look in the trace buffer. */
- void (*to_trace_set_readonly_regions) (struct target_ops *);
+ void (*to_trace_set_readonly_regions) (struct target_ops *)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Start a trace run. */
- void (*to_trace_start) (struct target_ops *);
+ void (*to_trace_start) (struct target_ops *)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Get the current status of a tracing run. */
- int (*to_get_trace_status) (struct target_ops *, struct trace_status *ts);
+ int (*to_get_trace_status) (struct target_ops *, struct trace_status *ts)
+ TARGET_DEFAULT_RETURN (-1);
void (*to_get_tracepoint_status) (struct target_ops *,
struct breakpoint *tp,
- struct uploaded_tp *utp);
+ struct uploaded_tp *utp)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Stop a trace run. */
- void (*to_trace_stop) (struct target_ops *);
+ void (*to_trace_stop) (struct target_ops *)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Ask the target to find a trace frame of the given type TYPE,
using NUM, ADDR1, and ADDR2 as search parameters. Returns the
@@ -835,18 +841,22 @@ struct target_ops
operation fails. */
int (*to_trace_find) (struct target_ops *,
enum trace_find_type type, int num,
- CORE_ADDR addr1, CORE_ADDR addr2, int *tpp);
+ CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
+ TARGET_DEFAULT_RETURN (-1);
/* Get the value of the trace state variable number TSV, returning
1 if the value is known and writing the value itself into the
location pointed to by VAL, else returning 0. */
int (*to_get_trace_state_variable_value) (struct target_ops *,
- int tsv, LONGEST *val);
+ int tsv, LONGEST *val)
+ TARGET_DEFAULT_RETURN (0);
- int (*to_save_trace_data) (struct target_ops *, const char *filename);
+ int (*to_save_trace_data) (struct target_ops *, const char *filename)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
int (*to_upload_tracepoints) (struct target_ops *,
- struct uploaded_tp **utpp);
+ struct uploaded_tp **utpp)
+ TARGET_DEFAULT_RETURN (0);
int (*to_upload_trace_state_variables) (struct target_ops *,
struct uploaded_tsv **utsvp);
--
1.8.1.4
next prev parent reply other threads:[~2014-01-13 19:13 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 19:12 [RFC 00/32] clean up target delegation Tom Tromey
2014-01-13 19:12 ` [RFC 01/32] add "this" pointers to more target APIs Tom Tromey
2014-01-14 12:10 ` Pedro Alves
2014-01-14 20:25 ` Tom Tromey
2014-01-13 19:12 ` [RFC 02/32] introduce and use find_target_at Tom Tromey
2014-01-14 11:48 ` [PATCH] Fix "is a record target open" checks Pedro Alves
2014-01-14 15:30 ` Tom Tromey
2014-01-14 18:27 ` Pedro Alves
2014-01-15 16:22 ` Tom Tromey
2014-01-13 19:12 ` [RFC 03/32] introduce async_callback_ftype Tom Tromey
2014-01-14 10:35 ` Pedro Alves
2014-01-14 10:50 ` Joel Brobecker
2014-01-14 15:06 ` Tom Tromey
2014-01-14 17:19 ` Joel Brobecker
2014-01-14 17:27 ` Tom Tromey
2014-01-14 18:30 ` Pedro Alves
2014-01-14 19:45 ` Tom Tromey
2014-01-15 15:25 ` Tom Tromey
2014-01-13 19:13 ` [RFC 31/32] change delegation for to_read_description Tom Tromey
2014-01-14 20:07 ` Pedro Alves
2014-01-14 20:22 ` Tom Tromey
2014-01-13 19:13 ` [RFC 26/32] convert to_static_tracepoint_markers_by_strid Tom Tromey
2014-01-14 18:57 ` Pedro Alves
2014-01-13 19:13 ` [RFC 32/32] minor cleanups to update_current_target Tom Tromey
2014-01-14 20:10 ` Pedro Alves
2014-01-13 19:13 ` [RFC 04/32] add make-target-delegates Tom Tromey
2014-01-14 10:52 ` Pedro Alves
2014-01-14 14:46 ` Tom Tromey
2014-01-13 19:13 ` [RFC 10/32] Add target_ops argument to to_terminal_init Tom Tromey
2014-01-14 12:51 ` Pedro Alves
2014-01-13 19:13 ` [RFC 25/32] convert to_upload_trace_state_variables Tom Tromey
2014-01-14 19:38 ` Pedro Alves
2014-01-13 19:13 ` [RFC 08/32] remove extended_remote_create_inferior_1 Tom Tromey
2014-01-14 12:41 ` Pedro Alves
2014-01-16 19:20 ` Tom Tromey
2014-01-13 19:13 ` [RFC 09/32] Add target_ops argument to to_close Tom Tromey
2014-01-14 12:48 ` Pedro Alves
2014-01-13 19:13 ` [RFC 11/32] Add target_ops argument to to_insert_vfork_catchpoint Tom Tromey
2014-01-14 12:52 ` Pedro Alves
2014-01-13 19:13 ` [RFC 27/32] convert to_insert_mask_watchpoint Tom Tromey
2014-01-14 19:15 ` Pedro Alves
2014-01-14 19:23 ` Tom Tromey
2014-01-13 19:13 ` [RFC 19/32] convert to_detach Tom Tromey
2014-01-14 13:32 ` Pedro Alves
2014-01-13 19:13 ` [RFC 12/32] Add target_ops argument to to_thread_name Tom Tromey
2014-01-14 13:03 ` Pedro Alves
2014-01-15 16:45 ` Tom Tromey
2014-01-16 17:50 ` Pedro Alves
2014-01-13 19:13 ` Tom Tromey [this message]
2014-01-14 18:49 ` [RFC 24/32] convert to_disable_tracepoint Pedro Alves
2014-01-13 19:23 ` [RFC 13/32] Add target_ops argument to to_get_ada_task_ptid Tom Tromey
2014-01-14 13:21 ` Pedro Alves
2014-01-13 19:23 ` [RFC 07/32] introduce remote_load Tom Tromey
2014-01-14 12:39 ` Pedro Alves
2014-01-13 19:23 ` [RFC 20/32] convert to_remove_watchpoint Tom Tromey
2014-01-14 18:39 ` Pedro Alves
2014-01-14 18:55 ` Tom Tromey
2014-01-14 19:07 ` Tom Tromey
2014-01-14 20:38 ` Pedro Alves
2014-01-14 21:47 ` Tom Tromey
2014-01-13 19:23 ` [RFC 17/32] Add target_ops argument to to_static_tracepoint_markers_by_strid Tom Tromey
2014-01-14 13:25 ` Pedro Alves
2014-01-13 19:24 ` [RFC 06/32] convert to_supports_btrace Tom Tromey
2014-01-14 12:37 ` Pedro Alves
2014-01-15 16:55 ` Tom Tromey
2014-01-13 19:24 ` [RFC 30/32] convert to_search_memory Tom Tromey
2014-01-14 19:45 ` Pedro Alves
2014-01-14 20:20 ` Tom Tromey
2014-01-13 19:24 ` [RFC 16/32] Add target_ops argument to to_upload_trace_state_variables Tom Tromey
2014-01-14 13:24 ` Pedro Alves
2014-01-13 19:37 ` [RFC 21/32] convert to_load Tom Tromey
2014-01-14 18:41 ` Pedro Alves
2014-01-13 19:38 ` [RFC 05/32] add target method delegation Tom Tromey
2014-01-14 12:32 ` Pedro Alves
2014-01-20 22:00 ` Tom Tromey
2014-01-13 19:38 ` [RFC 22/32] convert to_extra_thread_info Tom Tromey
2014-01-14 18:43 ` Pedro Alves
2014-01-13 19:38 ` [RFC 28/32] convert to_get_section_table Tom Tromey
2014-01-14 19:23 ` Pedro Alves
2014-01-14 19:29 ` Tom Tromey
2014-01-14 19:30 ` Pedro Alves
2014-01-15 16:43 ` Tom Tromey
2014-01-16 17:51 ` Pedro Alves
2014-01-13 19:38 ` [RFC 23/32] convert to_thread_architecture Tom Tromey
2014-01-14 18:46 ` Pedro Alves
2014-01-13 19:38 ` [RFC 18/32] Add target_ops argument to to_save_record Tom Tromey
2014-01-14 13:26 ` Pedro Alves
2014-01-13 19:40 ` [RFC 29/32] convert to_insn_history Tom Tromey
2014-01-14 19:29 ` Pedro Alves
2014-01-13 19:57 ` [RFC 14/32] Add target_ops argument to to_fileio_pwrite Tom Tromey
2014-01-14 13:22 ` Pedro Alves
2014-01-13 19:57 ` [RFC 15/32] Add target_ops argument to to_disable_tracepoint Tom Tromey
2014-01-14 13:23 ` Pedro Alves
2014-01-14 20:31 ` go32 fix Pedro Alves
2014-01-14 21:58 ` Tom Tromey
2014-01-15 12:55 ` [RFC 00/32] clean up target delegation Pedro Alves
2014-01-15 16:11 ` Tom Tromey
2014-01-15 20:05 ` Tom Tromey
2014-01-16 17:33 ` Pedro Alves
2014-01-16 19:09 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389640367-5571-25-git-send-email-tromey@redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).