From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22417 invoked by alias); 31 Aug 2008 18:12:57 -0000 Received: (qmail 22409 invoked by uid 22791); 31 Aug 2008 18:12:56 -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; Sun, 31 Aug 2008 18:12:13 +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 m7VHpgGp701088 for ; Sun, 31 Aug 2008 17:51:42 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 v9.0) with ESMTP id m7VHphdH2822200 for ; Sun, 31 Aug 2008 19:51:43 +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 m7VHpeJ7020293 for ; Sun, 31 Aug 2008 19:51:40 +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 ESMTP id m7VHpeN5020290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 31 Aug 2008 19:51:40 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (localhost.localdomain [127.0.0.1]) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpdhn003200 for ; Sun, 31 Aug 2008 19:51:39 +0200 Received: (from uweigand@localhost) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8/Submit) id m7VHpdeD003199 for gdb-patches@sourceware.org; Sun, 31 Aug 2008 19:51:39 +0200 Message-Id: <20080831175139.627298000@de.ibm.com> References: <20080831175045.128504000@de.ibm.com> User-Agent: quilt/0.46-1 Date: Sun, 31 Aug 2008 18:12:00 -0000 From: uweigand@de.ibm.com To: gdb-patches@sourceware.org Subject: [rfc][34/37] Eliminate builtin_type_ macros: Use target arch in procfs.c Content-Disposition: inline; filename=diff-type-procfs 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: 2008-08/txt/msg00707.txt.bz2 Hello, procfs.c uses gdbarch_address_to_pointer to convert a target address into a host address to be passed to the OS when setting watchpoints. This patch changes procfs_address_to_host_pointer to use the per-target architecture and its associated pointer types to perform that conversion. It also removes and unnecessary reference to builtin_type_void_data_ptr in procfs_auxv_parse. Bye, Ulrich ChangeLog: * procfs.c (procfs_address_to_host_pointer): Use target_gdbarch and its associated types to perform pointer conversion. (procfs_can_use_hw_breakpoint): Likewise. (procfs_auxv_parse): Remove unused variable. Index: gdb-head/gdb/procfs.c =================================================================== --- gdb-head.orig/gdb/procfs.c +++ gdb-head/gdb/procfs.c @@ -160,7 +160,6 @@ static int procfs_auxv_parse (struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) { - const int pointer_size = TYPE_LENGTH (builtin_type_void_data_ptr); gdb_byte *ptr = *readptr; if (endptr == ptr) @@ -2899,11 +2898,11 @@ proc_parent_pid (procinfo *pi) static void * procfs_address_to_host_pointer (CORE_ADDR addr) { + struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; void *ptr; - gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); - gdbarch_address_to_pointer (current_gdbarch, builtin_type_void_data_ptr, - &ptr, addr); + gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type)); + gdbarch_address_to_pointer (target_gdbarch, ptr_type, &ptr, addr); return ptr; } @@ -5361,7 +5360,8 @@ procfs_can_use_hw_breakpoint (int type, procfs_address_to_host_pointer will reveal that an internal error will be generated when the host and target pointer sizes are different. */ - if (sizeof (void *) != TYPE_LENGTH (builtin_type_void_data_ptr)) + struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; + if (sizeof (void *) != TYPE_LENGTH (ptr_type)) return 0; /* Other tests here??? */ -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com