From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [RFC v2 24/38] convert to_upload_trace_state_variables
Date: Thu, 06 Feb 2014 20:56:00 -0000 [thread overview]
Message-ID: <1391720136-2121-25-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1391720136-2121-1-git-send-email-tromey@redhat.com>
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_upload_trace_state_variables.
* target.h (struct target_ops) <to_upload_trace_state_variables>:
Use TARGET_DEFAULT_RETURN.
convert to_get_raw_trace_data
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_raw_trace_data.
* target.h (struct target_ops) <to_get_raw_trace_data>: Use
TARGET_DEFAULT_NORETURN.
convert to_get_min_fast_tracepoint_insn_len
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_min_fast_tracepoint_insn_len.
(return_minus_one): Remove.
* target.h (struct target_ops)
<to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN.
convert to_set_disconnected_tracing
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_disconnected_tracing.
* target.h (struct target_ops) <to_set_disconnected_tracing>: Use
TARGET_DEFAULT_IGNORE.
convert to_set_circular_trace_buffer
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_circular_trace_buffer.
* target.h (struct target_ops) <to_set_circular_trace_buffer>: Use
TARGET_DEFAULT_IGNORE.
convert to_set_trace_buffer_size
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't initialize
to_set_trace_buffer_size.
* target.h (struct target_ops) <to_set_trace_buffer_size>: Use
TARGET_DEFAULT_IGNORE.
convert to_set_trace_notes
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_trace_notes.
* target.h (struct target_ops) <to_set_trace_notes>: Use
TARGET_DEFAULT_RETURN.
convert to_get_tib_address
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_tib_address.
* target.h (struct target_ops) <to_get_tib_address>: Use
TARGET_DEFAULT_NORETURN.
convert to_set_permissions
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_permissions.
* target.h (struct target_ops) <to_set_permissions>: Use
TARGET_DEFAULT_IGNORE.
convert to_static_tracepoint_marker_at
2014-02-06 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_static_tracepoint_marker_at.
* target.h (struct target_ops) <to_static_tracepoint_marker_at>:
Use TARGET_DEFAULT_RETURN.
---
gdb/ChangeLog | 81 +++++++++++++++++++++++++
gdb/target-delegates.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++
gdb/target.c | 60 ++++---------------
gdb/target.h | 30 ++++++----
4 files changed, 267 insertions(+), 60 deletions(-)
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index d8d3dbd..968d2fd 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -833,6 +833,132 @@ tdefault_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1)
}
static int
+delegate_upload_trace_state_variables (struct target_ops *self, struct uploaded_tsv **arg1)
+{
+ self = self->beneath;
+ return self->to_upload_trace_state_variables (self, arg1);
+}
+
+static int
+tdefault_upload_trace_state_variables (struct target_ops *self, struct uploaded_tsv **arg1)
+{
+ return 0;
+}
+
+static LONGEST
+delegate_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST arg2, LONGEST arg3)
+{
+ self = self->beneath;
+ return self->to_get_raw_trace_data (self, arg1, arg2, arg3);
+}
+
+static LONGEST
+tdefault_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST arg2, LONGEST arg3)
+{
+ tcomplain ();
+}
+
+static int
+delegate_get_min_fast_tracepoint_insn_len (struct target_ops *self)
+{
+ self = self->beneath;
+ return self->to_get_min_fast_tracepoint_insn_len (self);
+}
+
+static int
+tdefault_get_min_fast_tracepoint_insn_len (struct target_ops *self)
+{
+ return -1;
+}
+
+static void
+delegate_set_disconnected_tracing (struct target_ops *self, int arg1)
+{
+ self = self->beneath;
+ self->to_set_disconnected_tracing (self, arg1);
+}
+
+static void
+tdefault_set_disconnected_tracing (struct target_ops *self, int arg1)
+{
+}
+
+static void
+delegate_set_circular_trace_buffer (struct target_ops *self, int arg1)
+{
+ self = self->beneath;
+ self->to_set_circular_trace_buffer (self, arg1);
+}
+
+static void
+tdefault_set_circular_trace_buffer (struct target_ops *self, int arg1)
+{
+}
+
+static void
+delegate_set_trace_buffer_size (struct target_ops *self, LONGEST arg1)
+{
+ self = self->beneath;
+ self->to_set_trace_buffer_size (self, arg1);
+}
+
+static void
+tdefault_set_trace_buffer_size (struct target_ops *self, LONGEST arg1)
+{
+}
+
+static int
+delegate_set_trace_notes (struct target_ops *self, const char *arg1, const char *arg2, const char *arg3)
+{
+ self = self->beneath;
+ return self->to_set_trace_notes (self, arg1, arg2, arg3);
+}
+
+static int
+tdefault_set_trace_notes (struct target_ops *self, const char *arg1, const char *arg2, const char *arg3)
+{
+ return 0;
+}
+
+static int
+delegate_get_tib_address (struct target_ops *self, ptid_t arg1, CORE_ADDR *arg2)
+{
+ self = self->beneath;
+ return self->to_get_tib_address (self, arg1, arg2);
+}
+
+static int
+tdefault_get_tib_address (struct target_ops *self, ptid_t arg1, CORE_ADDR *arg2)
+{
+ tcomplain ();
+}
+
+static void
+delegate_set_permissions (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_set_permissions (self);
+}
+
+static void
+tdefault_set_permissions (struct target_ops *self)
+{
+}
+
+static int
+delegate_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR arg1, struct static_tracepoint_marker *arg2)
+{
+ self = self->beneath;
+ return self->to_static_tracepoint_marker_at (self, arg1, arg2);
+}
+
+static int
+tdefault_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR arg1, struct static_tracepoint_marker *arg2)
+{
+ return 0;
+}
+
+static int
delegate_supports_btrace (struct target_ops *self)
{
self = self->beneath;
@@ -990,6 +1116,26 @@ install_delegators (struct target_ops *ops)
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_upload_trace_state_variables == NULL)
+ ops->to_upload_trace_state_variables = delegate_upload_trace_state_variables;
+ if (ops->to_get_raw_trace_data == NULL)
+ ops->to_get_raw_trace_data = delegate_get_raw_trace_data;
+ if (ops->to_get_min_fast_tracepoint_insn_len == NULL)
+ ops->to_get_min_fast_tracepoint_insn_len = delegate_get_min_fast_tracepoint_insn_len;
+ if (ops->to_set_disconnected_tracing == NULL)
+ ops->to_set_disconnected_tracing = delegate_set_disconnected_tracing;
+ if (ops->to_set_circular_trace_buffer == NULL)
+ ops->to_set_circular_trace_buffer = delegate_set_circular_trace_buffer;
+ if (ops->to_set_trace_buffer_size == NULL)
+ ops->to_set_trace_buffer_size = delegate_set_trace_buffer_size;
+ if (ops->to_set_trace_notes == NULL)
+ ops->to_set_trace_notes = delegate_set_trace_notes;
+ if (ops->to_get_tib_address == NULL)
+ ops->to_get_tib_address = delegate_get_tib_address;
+ if (ops->to_set_permissions == NULL)
+ ops->to_set_permissions = delegate_set_permissions;
+ if (ops->to_static_tracepoint_marker_at == NULL)
+ ops->to_static_tracepoint_marker_at = delegate_static_tracepoint_marker_at;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
}
@@ -1068,5 +1214,15 @@ install_dummy_methods (struct target_ops *ops)
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_upload_trace_state_variables = tdefault_upload_trace_state_variables;
+ ops->to_get_raw_trace_data = tdefault_get_raw_trace_data;
+ ops->to_get_min_fast_tracepoint_insn_len = tdefault_get_min_fast_tracepoint_insn_len;
+ ops->to_set_disconnected_tracing = tdefault_set_disconnected_tracing;
+ ops->to_set_circular_trace_buffer = tdefault_set_circular_trace_buffer;
+ ops->to_set_trace_buffer_size = tdefault_set_trace_buffer_size;
+ ops->to_set_trace_notes = tdefault_set_trace_notes;
+ ops->to_get_tib_address = tdefault_get_tib_address;
+ ops->to_set_permissions = tdefault_set_permissions;
+ ops->to_static_tracepoint_marker_at = tdefault_static_tracepoint_marker_at;
ops->to_supports_btrace = tdefault_supports_btrace;
}
diff --git a/gdb/target.c b/gdb/target.c
index 4657120..31be211 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -66,8 +66,6 @@ static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
static int return_zero (void);
-static int return_minus_one (void);
-
static void *return_null (void);
void target_ignore (void);
@@ -703,16 +701,16 @@ update_current_target (void)
/* 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);
- INHERIT (to_set_disconnected_tracing, t);
- INHERIT (to_set_circular_trace_buffer, t);
- INHERIT (to_set_trace_buffer_size, t);
- INHERIT (to_set_trace_notes, t);
- INHERIT (to_get_tib_address, t);
- INHERIT (to_set_permissions, t);
- INHERIT (to_static_tracepoint_marker_at, t);
+ /* Do not inherit to_upload_trace_state_variables. */
+ /* Do not inherit to_get_raw_trace_data. */
+ /* Do not inherit to_get_min_fast_tracepoint_insn_len. */
+ /* Do not inherit to_set_disconnected_tracing. */
+ /* Do not inherit to_set_circular_trace_buffer. */
+ /* Do not inherit to_set_trace_buffer_size. */
+ /* Do not inherit to_set_trace_notes. */
+ /* Do not inherit to_get_tib_address. */
+ /* Do not inherit to_set_permissions. */
+ /* Do not inherit to_static_tracepoint_marker_at. */
INHERIT (to_static_tracepoint_markers_by_strid, t);
INHERIT (to_traceframe_info, t);
INHERIT (to_use_agent, t);
@@ -752,38 +750,6 @@ update_current_target (void)
(void (*) (struct target_ops *, ptid_t))
target_ignore);
current_target.to_read_description = NULL;
- de_fault (to_upload_trace_state_variables,
- (int (*) (struct target_ops *, struct uploaded_tsv **))
- return_zero);
- de_fault (to_get_raw_trace_data,
- (LONGEST (*) (struct target_ops *, gdb_byte *, ULONGEST, LONGEST))
- tcomplain);
- de_fault (to_get_min_fast_tracepoint_insn_len,
- (int (*) (struct target_ops *))
- return_minus_one);
- de_fault (to_set_disconnected_tracing,
- (void (*) (struct target_ops *, int))
- target_ignore);
- de_fault (to_set_circular_trace_buffer,
- (void (*) (struct target_ops *, int))
- target_ignore);
- de_fault (to_set_trace_buffer_size,
- (void (*) (struct target_ops *, LONGEST))
- target_ignore);
- de_fault (to_set_trace_notes,
- (int (*) (struct target_ops *,
- const char *, const char *, const char *))
- return_zero);
- de_fault (to_get_tib_address,
- (int (*) (struct target_ops *, ptid_t, CORE_ADDR *))
- tcomplain);
- de_fault (to_set_permissions,
- (void (*) (struct target_ops *))
- target_ignore);
- de_fault (to_static_tracepoint_marker_at,
- (int (*) (struct target_ops *,
- CORE_ADDR, struct static_tracepoint_marker *))
- return_zero);
de_fault (to_static_tracepoint_markers_by_strid,
(VEC(static_tracepoint_marker_p) * (*) (struct target_ops *,
const char *))
@@ -3455,12 +3421,6 @@ return_zero (void)
return 0;
}
-static int
-return_minus_one (void)
-{
- return -1;
-}
-
static void *
return_null (void)
{
diff --git a/gdb/target.h b/gdb/target.h
index 4286874..40b3e57 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -864,29 +864,36 @@ struct target_ops
TARGET_DEFAULT_RETURN (0);
int (*to_upload_trace_state_variables) (struct target_ops *,
- struct uploaded_tsv **utsvp);
+ struct uploaded_tsv **utsvp)
+ TARGET_DEFAULT_RETURN (0);
LONGEST (*to_get_raw_trace_data) (struct target_ops *, gdb_byte *buf,
- ULONGEST offset, LONGEST len);
+ ULONGEST offset, LONGEST len)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Get the minimum length of instruction on which a fast tracepoint
may be set on the target. If this operation is unsupported,
return -1. If for some reason the minimum length cannot be
determined, return 0. */
- int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *);
+ int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *)
+ TARGET_DEFAULT_RETURN (-1);
/* Set the target's tracing behavior in response to unexpected
disconnection - set VAL to 1 to keep tracing, 0 to stop. */
- void (*to_set_disconnected_tracing) (struct target_ops *, int val);
- void (*to_set_circular_trace_buffer) (struct target_ops *, int val);
+ void (*to_set_disconnected_tracing) (struct target_ops *, int val)
+ TARGET_DEFAULT_IGNORE ();
+ void (*to_set_circular_trace_buffer) (struct target_ops *, int val)
+ TARGET_DEFAULT_IGNORE ();
/* Set the size of trace buffer in the target. */
- void (*to_set_trace_buffer_size) (struct target_ops *, LONGEST val);
+ void (*to_set_trace_buffer_size) (struct target_ops *, LONGEST val)
+ TARGET_DEFAULT_IGNORE ();
/* Add/change textual notes about the trace run, returning 1 if
successful, 0 otherwise. */
int (*to_set_trace_notes) (struct target_ops *,
const char *user, const char *notes,
- const char *stopnotes);
+ const char *stopnotes)
+ TARGET_DEFAULT_RETURN (0);
/* Return the processor core that thread PTID was last seen on.
This information is updated only when:
@@ -907,15 +914,18 @@ struct target_ops
/* Return the address of the start of the Thread Information Block
a Windows OS specific feature. */
int (*to_get_tib_address) (struct target_ops *,
- ptid_t ptid, CORE_ADDR *addr);
+ ptid_t ptid, CORE_ADDR *addr)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Send the new settings of write permission variables. */
- void (*to_set_permissions) (struct target_ops *);
+ void (*to_set_permissions) (struct target_ops *)
+ TARGET_DEFAULT_IGNORE ();
/* Look for a static tracepoint marker at ADDR, and fill in MARKER
with its details. Return 1 on success, 0 on failure. */
int (*to_static_tracepoint_marker_at) (struct target_ops *, CORE_ADDR,
- struct static_tracepoint_marker *marker);
+ struct static_tracepoint_marker *marker)
+ TARGET_DEFAULT_RETURN (0);
/* Return a vector of all tracepoints markers string id ID, or all
markers if ID is NULL. */
--
1.8.1.4
next prev parent reply other threads:[~2014-02-06 20:56 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 20:55 [RFC v2 00/38] clean up target delegation Tom Tromey
2014-02-06 20:55 ` [RFC v2 02/38] introduce and use find_target_at Tom Tromey
2014-02-07 15:43 ` Pedro Alves
2014-02-07 21:54 ` Tom Tromey
2014-02-10 14:28 ` Pedro Alves
2014-02-06 20:55 ` [RFC v2 09/38] Add target_ops argument to to_insert_vfork_catchpoint Tom Tromey
2014-02-06 20:55 ` [RFC v2 08/38] Add target_ops argument to to_terminal_init Tom Tromey
2014-02-06 20:55 ` [RFC v2 16/38] Add target_ops argument to to_static_tracepoint_markers_by_strid Tom Tromey
2014-02-06 20:55 ` [RFC v2 03/38] add make-target-delegates Tom Tromey
2014-02-06 20:56 ` [RFC v2 34/38] remove exec_set_find_memory_regions Tom Tromey
2014-02-06 20:56 ` [RFC v2 26/38] convert to_insert_mask_watchpoint Tom Tromey
2014-02-06 20:56 ` [RFC v2 36/38] convert to_decr_pc_after_break Tom Tromey
2014-02-06 20:56 ` Tom Tromey [this message]
2014-02-06 20:56 ` [RFC v2 32/38] remove function casts from target.c Tom Tromey
2014-02-06 20:56 ` [RFC v2 23/38] convert to_disable_tracepoint Tom Tromey
2014-02-06 20:56 ` [RFC v2 28/38] convert to_insn_history Tom Tromey
2014-02-06 20:56 ` [RFC v2 10/38] Add target_ops argument to to_thread_name Tom Tromey
2014-02-06 20:56 ` [RFC v2 21/38] convert to_extra_thread_info Tom Tromey
2014-02-06 20:56 ` [RFC v2 37/38] fix buglet in nto-procfs.c Tom Tromey
2014-02-07 16:01 ` Pedro Alves
2014-02-06 20:56 ` [RFC v2 27/38] convert to_get_section_table Tom Tromey
2014-02-06 20:56 ` [RFC v2 22/38] convert to_thread_architecture Tom Tromey
2014-02-06 20:56 ` [RFC v2 35/38] remove some calls to INHERIT and de_fault Tom Tromey
2014-02-06 20:56 ` [RFC v2 01/38] add "this" pointers to more target APIs Tom Tromey
2014-02-08 5:19 ` Doug Evans
2014-02-10 22:36 ` Doug Evans
2014-02-10 23:01 ` Doug Evans
2014-02-12 19:56 ` Tom Tromey
2014-02-12 20:22 ` Doug Evans
2014-02-06 20:56 ` [RFC v2 29/38] convert to_search_memory Tom Tromey
2014-02-06 20:56 ` [RFC v2 07/38] Add target_ops argument to to_close Tom Tromey
2014-02-08 3:00 ` Yao Qi
2014-02-10 17:50 ` Tom Tromey
2014-02-06 20:58 ` [RFC v2 20/38] convert to_load Tom Tromey
2014-02-06 20:58 ` [RFC v2 04/38] add target method delegation Tom Tromey
2014-02-07 15:53 ` Pedro Alves
2014-02-07 21:37 ` Tom Tromey
2014-02-06 20:58 ` [RFC v2 17/38] Add target_ops argument to to_save_record Tom Tromey
2014-02-06 20:58 ` [RFC v2 11/38] Add target_ops argument to to_get_ada_task_ptid Tom Tromey
2014-02-06 20:58 ` [RFC v2 25/38] convert to_static_tracepoint_markers_by_strid Tom Tromey
2014-02-06 21:23 ` [RFC v2 15/38] Add target_ops argument to to_upload_trace_state_variables Tom Tromey
2014-02-06 21:23 ` [RFC v2 19/38] convert to_remove_watchpoint Tom Tromey
2014-02-06 21:23 ` [RFC v2 06/38] introduce remote_load Tom Tromey
2014-02-06 21:23 ` [RFC v2 12/38] Add target_ops argument to to_can_execute_reverse Tom Tromey
2014-02-06 21:24 ` [RFC v2 05/38] convert to_supports_btrace Tom Tromey
2014-02-06 21:24 ` [RFC v2 13/38] Add target_ops argument to to_fileio_pwrite Tom Tromey
2014-02-06 21:24 ` [RFC v2 14/38] Add target_ops argument to to_disable_tracepoint Tom Tromey
2014-02-06 21:24 ` [RFC v2 31/38] minor cleanups to update_current_target Tom Tromey
2014-02-06 21:38 ` [RFC v2 33/38] pass NULL to TARGET_DEFAULT_RETURN when appropriate Tom Tromey
2014-02-06 21:38 ` [RFC v2 30/38] change delegation for to_read_description Tom Tromey
2014-02-06 21:42 ` [RFC v2 18/38] convert to_detach Tom Tromey
2014-02-06 21:47 ` [RFC v2 38/38] convert to_get_unwinder and to_get_tailcall_unwinder to methods Tom Tromey
2014-02-07 16:02 ` Pedro Alves
2014-02-07 16:47 ` [RFC v2 00/38] clean up target delegation Pedro Alves
2014-02-19 16:35 ` 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=1391720136-2121-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