From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3653 invoked by alias); 25 Nov 2003 22:02:54 -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 3600 invoked from network); 25 Nov 2003 22:02:53 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 25 Nov 2003 22:02:53 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hAPM2nH31131 for ; Tue, 25 Nov 2003 17:02:49 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hAPM2la23364; Tue, 25 Nov 2003 17:02:47 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id hAPM2lH18093; Tue, 25 Nov 2003 14:02:47 -0800 Message-ID: <3FC3D186.1080604@redhat.com> Date: Tue, 25 Nov 2003 22:02:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney CC: gdb-patches@sources.redhat.com, Roland McGrath Subject: Re: [rfa/threads] Convert thread event descriptors to code addrs References: <3FC3C5EE.2090201@redhat.com> In-Reply-To: <3FC3C5EE.2090201@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00578.txt.bz2 Andrew Cagney wrote: > Hello, > > For PPC64 every function has two minimal symbols vis: > > .__nptl_create_event: the start address > __nptl_create_event: the descriptor > > This patch modifies ps_pglobal_lookup so that it always returns the > function's start address. Doing this ensures that libthread_db and > GDB's thread code are "on the same page" when it comes to the true > address of the thread-create and thread-death breakpoints. > > The alternative would be to modify libthread_db so that it knew that > PPC64 symbol were special but I suspect that it doesn't want to know > about such underlying details. > > ok for mainline? Yes, with typo correction noted below. > ------------------------------------------------------------------------ > > 2003-11-25 Andrew Cagney > > * proc-service.c (ps_pglobal_lookup): Convert function descriptors > into code addresses using gdbarch_convert_from_func_ptr_addr. > > Index: ./gdb/proc-service.c > =================================================================== > RCS file: /cvs/src/src/gdb/proc-service.c,v > retrieving revision 1.7 > diff -u -r1.7 proc-service.c > --- ./gdb/proc-service.c 24 Feb 2002 22:31:19 -0000 1.7 > +++ ./gdb/proc-service.c 25 Nov 2003 20:59:49 -0000 > @@ -181,7 +181,13 @@ > if (ms == NULL) > return PS_NOSYM; > > - *sym_addr = SYMBOL_VALUE_ADDRESS (ms); > + /* Get the addres, make certain that any descriptors are converted "address". > + into corresponding code addresses. (For PPC64, the symbol > + "__nptl_create_event" points at a function descriptor while this > + code needs the corresponding function's start address.) */ > + *sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch, > + SYMBOL_VALUE_ADDRESS (ms), > + ¤t_target); > return PS_OK; > } >