From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10010 invoked by alias); 14 Jun 2007 23:38:41 -0000 Received: (qmail 10002 invoked by uid 22791); 14 Jun 2007 23:38:40 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Jun 2007 23:38:36 +0000 Received: (qmail 3028 invoked from network); 14 Jun 2007 23:38:34 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Jun 2007 23:38:34 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.63) (envelope-from ) id 1Hyytd-00068L-7U; Thu, 14 Jun 2007 23:38:33 +0000 Date: Thu, 14 Jun 2007 23:38:00 -0000 From: "Joseph S. Myers" To: Thiago Jung Bauermann cc: gdb-patches ml Subject: Re: [PATCH] Fixes problem setting breakpoint in dynamic loader In-Reply-To: <1177701733.10993.27.camel@localhost.localdomain> Message-ID: References: <1177701733.10993.27.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/msg00287.txt.bz2 On Fri, 27 Apr 2007, Thiago Jung Bauermann wrote: > Hi folks, > > This is a re-submission of: > > http://sourceware.org/ml/gdb-patches/2006-07/msg00264.html This doesn't work properly for me. There seem to be at least two problems with relying on the implicit conversion by ppc_linux_convert_from_func_ptr_addr done when setting a breakpoint: * ppc_linux_convert_from_func_ptr_addr relies on being able to find the function descriptor address in a section table, but doesn't have current information about the load address of ld.so which has only just been determined in enable_break. * The function descriptor in ld.so has not yet been relocated (as part of ld.so applying relocations to itself) at the time this breakpoint is set. So after the address is extracted from the function descriptor, the load address of ld.so must be added to it again. (I think this provides an answer to Andreas's question in : the explicit conversion is needed so that this relocation applies when load_addr gets added to the address later before the breakpoint is set.) I have a patch version partly based on the earlier revision which does set the breakpoint correctly, but I still have other GDB problems I'm investigating with that patch applied. -- Joseph S. Myers joseph@codesourcery.com