From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17887 invoked by alias); 25 May 2006 02:26:43 -0000 Received: (qmail 17874 invoked by uid 22791); 25 May 2006 02:26:40 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 25 May 2006 02:26:38 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Fj5YZ-0003vd-Sz; Wed, 24 May 2006 22:26:35 -0400 Date: Thu, 25 May 2006 16:27:00 -0000 From: Daniel Jacobowitz To: PAUL GILLIAM Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Fixes problem setting breakpoint in dynamic loader Message-ID: <20060525022635.GA15026@nevyn.them.org> Mail-Followup-To: PAUL GILLIAM , gdb-patches@sources.redhat.com References: <1148513171.315.104.camel@dufur.beaverton.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1148513171.315.104.camel@dufur.beaverton.ibm.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00459.txt.bz2 On Wed, May 24, 2006 at 04:26:11PM -0700, PAUL GILLIAM wrote: > + interp_sect = bfd_get_section_by_name (tmp_bfd, ".plt"); > + interp_sect = bfd_get_section_by_name (tmp_bfd, ".opd"); Magic names... > + if (interp_sect != 0) > + { > + /* Try to convert the function descriptor we found above, into > + the address we need. It will be relocated below by adding > + "load_addr" to it. */ > + char *buf = alloca (sizeof (LONGEST)); > + if (bfd_get_section_contents (tmp_bfd, interp_sect, buf, > + sym_addr - sect_offset, > + sizeof (LONGEST))) > + sym_addr = extract_unsigned_integer (buf, sizeof (LONGEST)); > + else > + sym_addr = 0; > + } > + } > + ... and a magic load; you have no idea what the format of a function descriptor is, at this point. Can you make convert_from_func_ptr_addr do what you need? It needs a target_ops; conveniently you've got one (tmp_bfd_target). Some targets use a memory read function which honors the supplied target_ops, others don't. rs6000's doesn't so you'd need to fix that. -- Daniel Jacobowitz CodeSourcery