This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] Remove remote_translate_xfer_address gdbarch routine
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 9 May 2007 02:19:56 +0200 (CEST)
- Subject: [rfc] Remove remote_translate_xfer_address gdbarch routine
Hello,
this is another unused gdbarch routine: remote_translate_xfer_address.
While this is actually still called in remote.c, there is just a
single non-default definition in ia64-tdep.c, and this is a copy
of the generic routine. Thus the calls in remote.c are no-ops.
I'd suggest to remove this, but I'm not quite sure about the
history of the callback. Is this something we should attempt
to keep in case some future target will need it again?
(The reason why I'd like to get rid of it is the reference
to the global current_regcache. It's not completely clear
*what* registers should be referred to here ...)
Bye,
Ulrich
ChangeLog:
* gdbarch.sh (remote_translate_xfer_address): Remove.
* gdbarch.h, gdbarch.c: Regenerate.
* arch-utils.c (generic_remote_translate_xfer_address): Remove.
* arch-utils.h (generic_remote_translate_xfer_address): Remove.
* remote.c (remote_write_bytes_aux, remote_read_bytes): Do not
call gdbarch_remote_translate_xfer_address.
* frv-tdep.c (frv_gdbarch_init): Do not call
set_gdbarch_remote_translate_xfer_address.
* ia64-tdep.c (ia64_remote_translate_xfer_address): Remove.
(ia64_gdbarch_init): Do not install it.
diff -urNp gdb-orig/gdb/arch-utils.c gdb-head/gdb/arch-utils.c
--- gdb-orig/gdb/arch-utils.c 2007-05-05 00:37:09.000000000 +0200
+++ gdb-head/gdb/arch-utils.c 2007-05-09 01:46:41.228597441 +0200
@@ -119,16 +119,6 @@ generic_in_function_epilogue_p (struct g
return 0;
}
-void
-generic_remote_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR gdb_addr, int gdb_len,
- CORE_ADDR * rem_addr, int *rem_len)
-{
- *rem_addr = gdb_addr;
- *rem_len = gdb_len;
-}
-
/* Helper functions for INNER_THAN */
int
diff -urNp gdb-orig/gdb/arch-utils.h gdb-head/gdb/arch-utils.h
--- gdb-orig/gdb/arch-utils.h 2007-05-05 00:37:09.000000000 +0200
+++ gdb-head/gdb/arch-utils.h 2007-05-09 01:46:41.233596722 +0200
@@ -45,9 +45,6 @@ enum return_value_convention legacy_retu
address passed as an invisible first argument to the function. */
extern gdbarch_deprecated_use_struct_convention_ftype always_use_struct_convention;
-/* Typical remote_translate_xfer_address */
-extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address;
-
/* The only possible cases for inner_than. */
extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
diff -urNp gdb-orig/gdb/frv-tdep.c gdb-head/gdb/frv-tdep.c
--- gdb-orig/gdb/frv-tdep.c 2007-05-06 22:20:35.000000000 +0200
+++ gdb-head/gdb/frv-tdep.c 2007-05-09 01:46:41.250594279 +0200
@@ -1525,9 +1525,6 @@ frv_gdbarch_init (struct gdbarch_info in
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_remote_translate_xfer_address
- (gdbarch, generic_remote_translate_xfer_address);
-
/* Hardware watchpoint / breakpoint support. */
switch (info.bfd_arch_info->mach)
{
diff -urNp gdb-orig/gdb/gdbarch.c gdb-head/gdb/gdbarch.c
--- gdb-orig/gdb/gdbarch.c 2007-05-08 14:37:40.000000000 +0200
+++ gdb-head/gdb/gdbarch.c 2007-05-09 01:46:41.273590974 +0200
@@ -201,7 +201,6 @@ struct gdbarch
gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
CORE_ADDR decr_pc_after_break;
CORE_ADDR deprecated_function_start_offset;
- gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
gdbarch_remote_register_number_ftype *remote_register_number;
gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
CORE_ADDR frame_args_skip;
@@ -329,7 +328,6 @@ struct gdbarch startup_gdbarch =
0, /* memory_remove_breakpoint */
0, /* decr_pc_after_break */
0, /* deprecated_function_start_offset */
- generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
default_remote_register_number, /* remote_register_number */
0, /* fetch_tls_load_module_address */
0, /* frame_args_skip */
@@ -440,7 +438,6 @@ gdbarch_alloc (const struct gdbarch_info
current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
- current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
current_gdbarch->remote_register_number = default_remote_register_number;
current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
@@ -584,7 +581,6 @@ verify_gdbarch (struct gdbarch *current_
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
/* Skip verify of decr_pc_after_break, invalid_p == 0 */
/* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
- /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
/* Skip verify of remote_register_number, invalid_p == 0 */
/* Skip verify of fetch_tls_load_module_address, has predicate */
/* Skip verify of frame_args_skip, invalid_p == 0 */
@@ -1430,9 +1426,6 @@ gdbarch_dump (struct gdbarch *current_gd
"gdbarch_dump: remote_register_number = <0x%lx>\n",
(long) current_gdbarch->remote_register_number);
fprintf_unfiltered (file,
- "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
- (long) current_gdbarch->remote_translate_xfer_address);
- fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_return_value_p() = %d\n",
gdbarch_return_value_p (current_gdbarch));
fprintf_unfiltered (file,
@@ -2941,23 +2934,6 @@ set_gdbarch_deprecated_function_start_of
gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
}
-void
-gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
- gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
-}
-
-void
-set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
- gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
-{
- gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
-}
-
int
gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
{
diff -urNp gdb-orig/gdb/gdbarch.h gdb-head/gdb/gdbarch.h
--- gdb-orig/gdb/gdbarch.h 2007-05-08 14:37:40.000000000 +0200
+++ gdb-head/gdb/gdbarch.h 2007-05-09 01:46:41.327583214 +0200
@@ -910,10 +910,6 @@ extern void set_gdbarch_deprecated_funct
#define DEPRECATED_FUNCTION_START_OFFSET (gdbarch_deprecated_function_start_offset (current_gdbarch))
#endif
-typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
-extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
-extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
-
/* Return the remote protocol register number associated with this
register. Normally the identity mapping. */
diff -urNp gdb-orig/gdb/gdbarch.sh gdb-head/gdb/gdbarch.sh
--- gdb-orig/gdb/gdbarch.sh 2007-05-08 14:37:40.000000000 +0200
+++ gdb-head/gdb/gdbarch.sh 2007-05-09 01:46:41.383575167 +0200
@@ -564,8 +564,6 @@ v:=:CORE_ADDR:decr_pc_after_break:::0:::
v:=:CORE_ADDR:deprecated_function_start_offset:::0:::0
-m::void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len::generic_remote_translate_xfer_address::0
-
# Return the remote protocol register number associated with this
# register. Normally the identity mapping.
m::int:remote_register_number:int regno:regno::default_remote_register_number::0
diff -urNp gdb-orig/gdb/ia64-tdep.c gdb-head/gdb/ia64-tdep.c
--- gdb-orig/gdb/ia64-tdep.c 2007-05-06 22:28:28.000000000 +0200
+++ gdb-head/gdb/ia64-tdep.c 2007-05-09 01:46:41.441566832 +0200
@@ -3546,16 +3546,6 @@ ia64_store_return_value (struct type *ty
regcache_cooked_write (regcache, IA64_GR8_REGNUM, valbuf);
}
-static void
-ia64_remote_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR memaddr, int nr_bytes,
- CORE_ADDR *targ_addr, int *targ_len)
-{
- *targ_addr = memaddr;
- *targ_len = nr_bytes;
-}
-
static int
ia64_print_insn (bfd_vma memaddr, struct disassemble_info *info)
{
@@ -3657,9 +3647,6 @@ ia64_gdbarch_init (struct gdbarch_info i
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_remote_translate_xfer_address (
- gdbarch, ia64_remote_translate_xfer_address);
-
set_gdbarch_print_insn (gdbarch, ia64_print_insn);
set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
diff -urNp gdb-orig/gdb/remote.c gdb-head/gdb/remote.c
--- gdb-orig/gdb/remote.c 2007-05-08 14:37:44.000000000 +0200
+++ gdb-head/gdb/remote.c 2007-05-09 01:46:41.490559790 +0200
@@ -4104,12 +4104,6 @@ remote_write_bytes_aux (const char *head
internal_error (__FILE__, __LINE__,
"remote_write_bytes_aux: bad packet format");
- /* Should this be the selected frame? */
- gdbarch_remote_translate_xfer_address (current_gdbarch,
- current_regcache,
- memaddr, len,
- &memaddr, &len);
-
if (len <= 0)
return 0;
@@ -4302,12 +4296,6 @@ remote_read_bytes (CORE_ADDR memaddr, gd
int max_buf_size; /* Max size of packet output buffer. */
int origlen;
- /* Should this be the selected frame? */
- gdbarch_remote_translate_xfer_address (current_gdbarch,
- current_regcache,
- memaddr, len,
- &memaddr, &len);
-
if (len <= 0)
return 0;
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com