From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23062 invoked by alias); 23 Oct 2003 01:37:12 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23049 invoked from network); 23 Oct 2003 01:37:10 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 23 Oct 2003 01:37:10 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 8F93D2B89 for ; Wed, 22 Oct 2003 21:37:07 -0400 (EDT) Message-ID: <3F9730C3.1040308@redhat.com> Date: Thu, 23 Oct 2003 01:37:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa:ppc64] Use target in convert_from_func_ptr_addr Content-Type: multipart/mixed; boundary="------------010807020906090207060908" X-SW-Source: 2003-10/txt/msg00675.txt.bz2 This is a multi-part message in MIME format. --------------010807020906090207060908 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 237 Hello, The attached rewrites the PPC64 GNU/Linux convert_from_func_ptr_addr method so that it makes use of the explicit "struct target_ops" parameter I recently added (previously it was indirectly using current_target). ok? Andrew --------------010807020906090207060908 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1116 2003-10-17 Andrew Cagney * ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): Rewrite to use target_ops when transfering memory. Index: ppc-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v retrieving revision 1.44 diff -u -r1.44 ppc-linux-tdep.c --- ppc-linux-tdep.c 22 Oct 2003 23:54:11 -0000 1.44 +++ ppc-linux-tdep.c 23 Oct 2003 01:32:51 -0000 @@ -936,14 +936,14 @@ CORE_ADDR addr, struct target_ops *targ) { - struct obj_section *s; - - s = find_pc_section (addr); - - /* Check if ADDR points to a function descriptor. */ - if (s && strcmp (s->the_bfd_section->name, ".opd") == 0) - return read_memory_unsigned_integer (addr, 8); - + struct section_table *s = target_section_by_addr (targ, addr); + if (s != NULL && s->the_bfd_section != NULL + && strcmp (s->the_bfd_section->name, ".opd") == 0) + { + char desc[8]; + target_read (targ, TARGET_OBJECT_MEMORY, NULL, desc, addr, 8); + return extract_unsigned_integer (desc, 8); + } return addr; } --------------010807020906090207060908--