diff options
author | Tom Tromey <tromey@adacore.com> | 2019-08-14 09:18:21 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-08-15 07:42:21 -0600 |
commit | 4196ab2a6d348f76c0e5e78252e44d9c631636d2 (patch) | |
tree | 94cdb8e141b9a10aa46f5234ae0ee5219443b872 /gdb/gdbserver/tracepoint.c | |
parent | c6778d00df0fbc7fe53801717eb934a5d7b9674a (diff) | |
download | binutils-4196ab2a6d348f76c0e5e78252e44d9c631636d2.zip binutils-4196ab2a6d348f76c0e5e78252e44d9c631636d2.tar.gz binutils-4196ab2a6d348f76c0e5e78252e44d9c631636d2.tar.bz2 |
Replace write_inferior_memory with target_write_memory
target_write_memory is just a simple wrapper for
write_inferior_memory. Because target_write_memory is needed for
gdbsupport, and because gdb uses the name "target_write_memory"
everywhere, this patch renames write_inferior_memory and removes the
wrapper. I think this brings gdb and gdbserver slightly more in sync.
gdb/gdbserver/ChangeLog
2019-08-15 Tom Tromey <tromey@adacore.com>
* tracepoint.c (write_inferior_data_pointer)
(write_inferior_integer, write_inferior_int8)
(write_inferior_uinteger, m_tracepoint_action_download)
(r_tracepoint_action_download, x_tracepoint_action_download)
(l_tracepoint_action_download, clear_inferior_trace_buffer)
(download_agent_expr, download_tracepoint_1)
(download_trace_state_variables, upload_fast_traceframes): Update.
* server.c (gdb_write_memory): Update.
* remote-utils.c (relocate_instruction): Update.
* proc-service.c (ps_pdwrite): Update.
* mem-break.c (remove_memory_breakpoint)
(delete_fast_tracepoint_jump, set_fast_tracepoint_jump)
(uninsert_fast_tracepoint_jumps_at)
(reinsert_fast_tracepoint_jumps_at): Update.
* linux-x86-low.c (append_insns)
(i386_install_fast_tracepoint_jump_pad)
(amd64_write_goto_address, i386_write_goto_address): Update.
* linux-s390-low.c (append_insns, s390_write_goto_address):
Update.
* linux-ppc-low.c (ppc_relocate_instruction)
(ppc_install_fast_tracepoint_jump_pad, emit_insns)
(ppc_write_goto_address): Update.
* linux-aarch64-low.c (append_insns): Update.
* target.h (struct target_ops): Update.
(write_inferior_memory): Don't declare.
* target.c (target_write_memory): Rename from
write_inferior_memory. Remove old target_write_memory.
Diffstat (limited to 'gdb/gdbserver/tracepoint.c')
-rw-r--r-- | gdb/gdbserver/tracepoint.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 09e7d5f..0d02639 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -440,26 +440,26 @@ static int write_inferior_data_pointer (CORE_ADDR symaddr, CORE_ADDR val) { void *pval = (void *) (uintptr_t) val; - return write_inferior_memory (symaddr, + return target_write_memory (symaddr, (unsigned char *) &pval, sizeof (pval)); } static int write_inferior_integer (CORE_ADDR symaddr, int val) { - return write_inferior_memory (symaddr, (unsigned char *) &val, sizeof (val)); + return target_write_memory (symaddr, (unsigned char *) &val, sizeof (val)); } static int write_inferior_int8 (CORE_ADDR symaddr, int8_t val) { - return write_inferior_memory (symaddr, (unsigned char *) &val, sizeof (val)); + return target_write_memory (symaddr, (unsigned char *) &val, sizeof (val)); } static int write_inferior_uinteger (CORE_ADDR symaddr, unsigned int val) { - return write_inferior_memory (symaddr, (unsigned char *) &val, sizeof (val)); + return target_write_memory (symaddr, (unsigned char *) &val, sizeof (val)); } static CORE_ADDR target_malloc (ULONGEST size); @@ -517,7 +517,7 @@ m_tracepoint_action_download (const struct tracepoint_action *action) { CORE_ADDR ipa_action = target_malloc (sizeof (struct collect_memory_action)); - write_inferior_memory (ipa_action, (unsigned char *) action, + target_write_memory (ipa_action, (unsigned char *) action, sizeof (struct collect_memory_action)); return ipa_action; @@ -540,7 +540,7 @@ r_tracepoint_action_download (const struct tracepoint_action *action) { CORE_ADDR ipa_action = target_malloc (sizeof (struct collect_registers_action)); - write_inferior_memory (ipa_action, (unsigned char *) action, + target_write_memory (ipa_action, (unsigned char *) action, sizeof (struct collect_registers_action)); return ipa_action; @@ -560,7 +560,7 @@ x_tracepoint_action_download (const struct tracepoint_action *action) CORE_ADDR ipa_action = target_malloc (sizeof (struct eval_expr_action)); CORE_ADDR expr; - write_inferior_memory (ipa_action, (unsigned char *) action, + target_write_memory (ipa_action, (unsigned char *) action, sizeof (struct eval_expr_action)); expr = download_agent_expr (((struct eval_expr_action *) action)->expr); write_inferior_data_pointer (ipa_action @@ -608,7 +608,7 @@ l_tracepoint_action_download (const struct tracepoint_action *action) CORE_ADDR ipa_action = target_malloc (sizeof (struct collect_static_trace_data_action)); - write_inferior_memory (ipa_action, (unsigned char *) action, + target_write_memory (ipa_action, (unsigned char *) action, sizeof (struct collect_static_trace_data_action)); return ipa_action; @@ -1458,14 +1458,14 @@ clear_inferior_trace_buffer (void) ipa_trace_buffer_ctrl.wrap = ipa_trace_buffer_hi; /* A traceframe with zeroed fields marks the end of trace data. */ - write_inferior_memory (ipa_sym_addrs.addr_trace_buffer_ctrl, + target_write_memory (ipa_sym_addrs.addr_trace_buffer_ctrl, (unsigned char *) &ipa_trace_buffer_ctrl, sizeof (ipa_trace_buffer_ctrl)); write_inferior_uinteger (ipa_sym_addrs.addr_trace_buffer_ctrl_curr, 0); /* A traceframe with zeroed fields marks the end of trace data. */ - write_inferior_memory (ipa_trace_buffer_lo, + target_write_memory (ipa_trace_buffer_lo, (unsigned char *) &ipa_traceframe, sizeof (ipa_traceframe)); @@ -6009,12 +6009,12 @@ download_agent_expr (struct agent_expr *expr) CORE_ADDR expr_bytes; expr_addr = target_malloc (sizeof (*expr)); - write_inferior_memory (expr_addr, (unsigned char *) expr, sizeof (*expr)); + target_write_memory (expr_addr, (unsigned char *) expr, sizeof (*expr)); expr_bytes = target_malloc (expr->length); write_inferior_data_pointer (expr_addr + offsetof (struct agent_expr, bytes), expr_bytes); - write_inferior_memory (expr_bytes, expr->bytes, expr->length); + target_write_memory (expr_bytes, expr->bytes, expr->length); return expr_addr; } @@ -6067,7 +6067,7 @@ download_tracepoint_1 (struct tracepoint *tpoint) tracepoints before clearing our own copy. */ target_tracepoint.hit_count = 0; - write_inferior_memory (tpptr, (unsigned char *) &target_tracepoint, + target_write_memory (tpptr, (unsigned char *) &target_tracepoint, sizeof (target_tracepoint)); if (tpoint->cond) @@ -6279,14 +6279,14 @@ download_trace_state_variables (void) Assume no next, fixup when needed. */ target_tsv.next = NULL; - write_inferior_memory (ptr, (unsigned char *) &target_tsv, + target_write_memory (ptr, (unsigned char *) &target_tsv, sizeof (target_tsv)); if (tsv->name != NULL) { size_t size = strlen (tsv->name) + 1; CORE_ADDR name_addr = target_malloc (size); - write_inferior_memory (name_addr, + target_write_memory (name_addr, (unsigned char *) tsv->name, size); write_inferior_data_pointer (ptr + offsetof (struct trace_state_variable, @@ -6548,7 +6548,7 @@ upload_fast_traceframes (void) (int) (ipa_trace_buffer_hi - ipa_trace_buffer_lo)); } - if (write_inferior_memory (ipa_trace_buffer_ctrl_addr, + if (target_write_memory (ipa_trace_buffer_ctrl_addr, (unsigned char *) &ipa_trace_buffer_ctrl, sizeof (struct ipa_trace_buffer_control))) return; |