From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5402 invoked by alias); 22 Jun 2007 12:52:56 -0000 Received: (qmail 5391 invoked by uid 22791); 22 Jun 2007 12:52:55 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Jun 2007 12:52:51 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5MCqn8p269562 for ; Fri, 22 Jun 2007 12:52:49 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5MCqmuW815192 for ; Fri, 22 Jun 2007 14:52:48 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5MCqmkN024771 for ; Fri, 22 Jun 2007 14:52:48 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l5MCqmK4024768; Fri, 22 Jun 2007 14:52:48 +0200 Message-Id: <200706221252.l5MCqmK4024768@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 22 Jun 2007 14:52:48 +0200 Subject: Re: [1/3] Remove gdbarch-swapping of remote_address_masked To: uweigand@de.ibm.com (Ulrich Weigand) Date: Fri, 22 Jun 2007 12:52:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200706082322.l58NMZAD019415@d12av02.megacenter.de.ibm.com> from "Ulrich Weigand" at Jun 09, 2007 01:22:35 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00420.txt.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. I've now committed the following version of this patch. Bye, Ulrich diff -urNp gdb-orig/gdb/remote.c gdb-head/gdb/remote.c --- gdb-orig/gdb/remote.c 2007-06-14 14:56:59.063426000 +0200 +++ gdb-head/gdb/remote.c 2007-06-14 15:01:54.131761491 +0200 @@ -85,8 +85,6 @@ static void handle_remote_sigint_twice ( 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); @@ -3926,13 +3924,18 @@ hexnumnstr (char *buf, ULONGEST num, int 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; @@ -6408,11 +6411,6 @@ show_remote_cmd (char *args, int from_tt 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 @@ -6433,11 +6431,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 -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com