From: Wei-cheng Wang <cole945@gmail.com>
To: uweigand@de.ibm.com, gdb-patches@sourceware.org
Cc: Wei-cheng Wang <cole945@gmail.com>
Subject: [PATCH 5/7 v3] Replace write_inferior_data_ptr with write_inferior_data_pointer.
Date: Mon, 30 Mar 2015 16:31:00 -0000 [thread overview]
Message-ID: <1427733032-64989-5-git-send-email-cole945@gmail.com> (raw)
In-Reply-To: <1427733032-64989-1-git-send-email-cole945@gmail.com>
gdb/gdbserver/ChangeLog
2015-03-30 Wei-cheng Wang <cole945@gmail.com>
* (write_inferior_data_ptr): Delete.
(x_tracepoint_action_download, cmd_qtstart,
compile_tracepoint_condition, download_agent_expr,
download_tracepoint_1, download_tracepoint,
download_trace_state_variables): Replace write_inferior_data_ptr
with write_inferior_data_pointer.
---
gdb/gdbserver/tracepoint.c | 87 ++++++++++++++++++++--------------------------
1 file changed, 37 insertions(+), 50 deletions(-)
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 39660c8..ff66434 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -455,7 +455,6 @@ write_inferior_uinteger (CORE_ADDR symaddr, unsigned int val)
}
static CORE_ADDR target_malloc (ULONGEST size);
-static int write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr);
#define COPY_FIELD_TO_BUF(BUF, OBJ, FIELD) \
do { \
@@ -592,9 +591,10 @@ x_tracepoint_action_download (const struct tracepoint_action *action)
write_inferior_memory (ipa_action, (unsigned char *) &action->type,
size_in_ipa);
expr = download_agent_expr (((struct eval_expr_action *)action)->expr);
- write_inferior_data_ptr (ipa_action + offsetof (struct eval_expr_action, expr)
- - offsetof (struct tracepoint_action, type),
- expr);
+ write_inferior_data_pointer (ipa_action
+ + offsetof (struct eval_expr_action, expr)
+ - offsetof (struct tracepoint_action, type),
+ expr);
return ipa_action;
}
@@ -3228,7 +3228,7 @@ cmd_qtstart (char *packet)
/* Start out empty. */
if (agent_loaded_p ())
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, 0);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints, 0);
/* Download and install tracepoints. */
for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
@@ -3324,11 +3324,11 @@ cmd_qtstart (char *packet)
if (tpoint == tracepoints)
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, tpptr);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints, tpptr);
else
- write_inferior_data_ptr (prev_tpptr + offsetof (struct tracepoint,
- next),
- tpptr);
+ write_inferior_data_pointer (prev_tpptr
+ + offsetof (struct tracepoint, next),
+ tpptr);
}
/* Any failure in the inner loop is sufficient cause to give
@@ -5923,16 +5923,6 @@ compile_tracepoint_condition (struct tracepoint *tpoint,
*jump_entry += 16;
}
-/* We'll need to adjust these when we consider bi-arch setups, and big
- endian machines. */
-
-static int
-write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
-{
- return write_inferior_memory (where,
- (unsigned char *) &ptr, sizeof (void *));
-}
-
/* The base pointer of the IPA's heap. This is the only memory the
IPA is allowed to use. The IPA should _not_ call the inferior's
`malloc' during operation. That'd be slow, and, most importantly,
@@ -5978,8 +5968,8 @@ download_agent_expr (struct agent_expr *expr)
write_inferior_memory (expr_addr, (unsigned char *) expr, sizeof (*expr));
expr_bytes = target_malloc (expr->length);
- write_inferior_data_ptr (expr_addr + offsetof (struct agent_expr, bytes),
- expr_bytes);
+ write_inferior_data_pointer (expr_addr + offsetof (struct agent_expr, bytes),
+ expr_bytes);
write_inferior_memory (expr_bytes, expr->bytes, expr->length);
return expr_addr;
@@ -6037,9 +6027,8 @@ download_tracepoint_1 (struct tracepoint *tpoint)
sizeof (target_tracepoint));
if (tpoint->cond)
- write_inferior_data_ptr (tpptr + offsetof (struct tracepoint,
- cond),
- download_agent_expr (tpoint->cond));
+ write_inferior_data_pointer (tpptr + offsetof (struct tracepoint, cond),
+ download_agent_expr (tpoint->cond));
if (tpoint->numactions)
{
@@ -6049,9 +6038,9 @@ download_tracepoint_1 (struct tracepoint *tpoint)
/* The pointers array. */
actions_array
= target_malloc (sizeof (*tpoint->actions) * tpoint->numactions);
- write_inferior_data_ptr (tpptr + offsetof (struct tracepoint,
- actions),
- actions_array);
+ write_inferior_data_pointer (tpptr
+ + offsetof (struct tracepoint, actions),
+ actions_array);
/* Now for each pointer, download the action. */
for (i = 0; i < tpoint->numactions; i++)
@@ -6060,7 +6049,7 @@ download_tracepoint_1 (struct tracepoint *tpoint)
CORE_ADDR ipa_action = action->ops->download (action);
if (ipa_action != 0)
- write_inferior_data_ptr
+ write_inferior_data_pointer
(actions_array + i * sizeof (*tpoint->actions),
ipa_action);
}
@@ -6186,19 +6175,19 @@ download_tracepoint (struct tracepoint *tpoint)
}
/* tpoint->next = tp_prev->next */
- write_inferior_data_ptr (tpoint->obj_addr_on_target
- + offsetof (struct tracepoint, next),
- tp_prev_target_next_addr);
+ write_inferior_data_pointer (tpoint->obj_addr_on_target
+ + offsetof (struct tracepoint, next),
+ tp_prev_target_next_addr);
/* tp_prev->next = tpoint */
- write_inferior_data_ptr (tp_prev->obj_addr_on_target
- + offsetof (struct tracepoint, next),
- tpoint->obj_addr_on_target);
+ write_inferior_data_pointer (tp_prev->obj_addr_on_target
+ + offsetof (struct tracepoint, next),
+ tpoint->obj_addr_on_target);
}
else
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints,
- tpoint->obj_addr_on_target);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints,
+ tpoint->obj_addr_on_target);
}
@@ -6209,7 +6198,7 @@ download_trace_state_variables (void)
struct trace_state_variable *tsv;
/* Start out empty. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables, 0);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_trace_state_variables, 0);
for (tsv = trace_state_variables; tsv != NULL; tsv = tsv->next)
{
@@ -6230,15 +6219,14 @@ download_trace_state_variables (void)
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables,
- ptr);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_trace_state_variables,
+ ptr);
}
else
{
- write_inferior_data_ptr (prev_ptr
- + offsetof (struct trace_state_variable,
- next),
- ptr);
+ write_inferior_data_pointer (prev_ptr
+ + offsetof (struct trace_state_variable,
+ next), ptr);
}
/* Write the whole object. We'll fix up its pointers in a bit.
@@ -6254,10 +6242,9 @@ download_trace_state_variables (void)
CORE_ADDR name_addr = target_malloc (size);
write_inferior_memory (name_addr,
(unsigned char *) tsv->name, size);
- write_inferior_data_ptr (ptr
- + offsetof (struct trace_state_variable,
- name),
- name_addr);
+ write_inferior_data_pointer (ptr
+ + offsetof (struct trace_state_variable,
+ name), name_addr);
}
gdb_assert (tsv->getter == NULL);
@@ -6266,9 +6253,9 @@ download_trace_state_variables (void)
if (prev_ptr != 0)
{
/* Fixup the next pointer in the last item in the list. */
- write_inferior_data_ptr (prev_ptr
- + offsetof (struct trace_state_variable,
- next), 0);
+ write_inferior_data_pointer (prev_ptr
+ + offsetof (struct trace_state_variable,
+ next), 0);
}
}
--
1.9.1
next prev parent reply other threads:[~2015-03-30 16:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 16:31 [PATCH 1/7 v3] powerpc: Support z-point type in gdbserver Wei-cheng Wang
2015-03-30 16:31 ` [PATCH 4/7 v3] Allow target to decide where to map jump-pad Wei-cheng Wang
2015-04-08 17:04 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 7/7 v3] Remove tracepoint_action ops Wei-cheng Wang
2015-04-08 17:09 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 3/7 v3] Add testcases for ppc64 tracepoint Wei-cheng Wang
2015-04-08 17:02 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 2/7 v3] Tracepoint for ppc64 Wei-cheng Wang
2015-04-08 16:57 ` Ulrich Weigand
2015-06-27 17:48 ` Wei-cheng Wang
2015-07-03 16:42 ` Ulrich Weigand
2015-03-30 16:31 ` Wei-cheng Wang [this message]
2015-04-08 17:06 ` [PATCH 5/7 v3] Replace write_inferior_data_ptr with write_inferior_data_pointer Ulrich Weigand
2015-03-30 16:31 ` [PATCH 6/7 v3] Build unavailable-stack frames for tracepoint Wei-cheng Wang
2015-04-08 17:07 ` Ulrich Weigand
2016-02-22 5:28 ` Marcin Kościelnicki
2016-02-23 18:58 ` Ulrich Weigand
2016-02-24 3:18 ` Marcin Kościelnicki
2016-02-24 20:44 ` Sergio Durigan Junior
2016-02-24 21:06 ` [PATCH] [OBV] gdb/rs6000: Fix maybe-uninitialized warning Marcin Kościelnicki
2015-04-08 16:56 ` [PATCH 1/7 v3] powerpc: Support z-point type in gdbserver Ulrich Weigand
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=1427733032-64989-5-git-send-email-cole945@gmail.com \
--to=cole945@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/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).