diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-22 12:36:00 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-22 12:36:00 +0000 |
commit | 911c95a5ae8f914319f5384146f1f05c1c59fe74 (patch) | |
tree | d6afe952ba23de4a2f14c4c04263499b6ed1a386 /gdb/remote.c | |
parent | 5674de600f8bea2ae04159ad20bb50e9d3d3a5f2 (diff) | |
download | gdb-911c95a5ae8f914319f5384146f1f05c1c59fe74.zip gdb-911c95a5ae8f914319f5384146f1f05c1c59fe74.tar.gz gdb-911c95a5ae8f914319f5384146f1f05c1c59fe74.tar.bz2 |
* remote.c (remote_address_masked): If remote_address_size is zero,
default to target address size.
(build_remote_gdbarch_data): Remove.
(_initialize_remote): Do not swap remote_address_size.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 3990a34..8b4c443 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -85,8 +85,6 @@ static void handle_remote_sigint_twice (int); static void async_remote_interrupt (gdb_client_data); void async_remote_interrupt_twice (gdb_client_data); -static void build_remote_gdbarch_data (void); - static void remote_files_info (struct target_ops *ignore); static void remote_prepare_to_store (struct regcache *regcache); @@ -3993,13 +3991,18 @@ hexnumnstr (char *buf, ULONGEST num, int width) static CORE_ADDR remote_address_masked (CORE_ADDR addr) { - if (remote_address_size > 0 - && remote_address_size < (sizeof (ULONGEST) * 8)) + int address_size = remote_address_size; + /* If "remoteaddresssize" was not set, default to target address size. */ + if (!address_size) + address_size = gdbarch_addr_bit (current_gdbarch); + + if (address_size > 0 + && address_size < (sizeof (ULONGEST) * 8)) { /* Only create a mask when that mask can safely be constructed in a ULONGEST variable. */ ULONGEST mask = 1; - mask = (mask << remote_address_size) - 1; + mask = (mask << address_size) - 1; addr &= mask; } return addr; @@ -6475,11 +6478,6 @@ show_remote_cmd (char *args, int from_tty) do_cleanups (showlist_chain); } -static void -build_remote_gdbarch_data (void) -{ - remote_address_size = gdbarch_addr_bit (current_gdbarch); -} /* Function to be called whenever a new objfile (shlib) is detected. */ static void @@ -6500,11 +6498,6 @@ _initialize_remote (void) remote_g_packet_data_handle = gdbarch_data_register_pre_init (remote_g_packet_data_init); - /* Old tacky stuff. NOTE: This comes after the remote protocol so - that the remote protocol has been initialized. */ - DEPRECATED_REGISTER_GDBARCH_SWAP (remote_address_size); - deprecated_register_gdbarch_swap (NULL, 0, build_remote_gdbarch_data); - /* Initialize the per-target state. At the moment there is only one of these, not one per target. Only one target is active at a time. The default buffer size is unimportant; it will be expanded |