From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1767 invoked by alias); 25 May 2006 22:56:06 -0000 Received: (qmail 1757 invoked by uid 22791); 25 May 2006 22:56:05 -0000 X-Spam-Check-By: sourceware.org Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 May 2006 22:56:01 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k4PMtvPr013351 for ; Thu, 25 May 2006 18:55:57 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k4PMtvjP229386 for ; Thu, 25 May 2006 16:55:57 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k4PMtqjp010834 for ; Thu, 25 May 2006 16:55:53 -0600 Received: from dufur.beaverton.ibm.com (dufur.beaverton.ibm.com [9.47.22.20]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k4PMtq13010799; Thu, 25 May 2006 16:55:52 -0600 Subject: Re: [patch] Fixes problem setting breakpoint in dynamic loader From: PAUL GILLIAM Reply-To: pgilliam@us.ibm.com To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com In-Reply-To: <20060525022635.GA15026@nevyn.them.org> References: <1148513171.315.104.camel@dufur.beaverton.ibm.com> <20060525022635.GA15026@nevyn.them.org> Content-Type: multipart/mixed; boundary="=-j9HshHCZXjpR1vlhBAD/" Date: Thu, 25 May 2006 22:58:00 -0000 Message-Id: <1148593970.315.131.camel@dufur.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) 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/msg00463.txt.bz2 --=-j9HshHCZXjpR1vlhBAD/ Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 2159 On Wed, 2006-05-24 at 22:26 -0400, Daniel Jacobowitz wrote: > 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... These aren't magic: they are common to all 64-bit ELF ABIs. Well, ok: maybe they're enchanted. > > > + 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. > uffda! I'm afraid I was just a little bit ppc64-centric. > 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. > Yes! Thank you: "gdbarch_convert_from_func_ptr_addr()" does exactly what I want. And while it's true that "rs6000_convert_from_func_ptr_addr()" does not use the target_ops, "ppc64_linux_convert_from_func_ptr_addr()" does and that is the version that is invoked on the configuration reporting the error I am trying to fix. I went ahead and converted "rs6000_convert_from_func_ptr_addr()" to use target_ops, but because I have no way to test the change, I thought it best to make it a separate patch. So is it OK to commit the solib-svr4.c patch? Does anyone want to test the rs6000-tdep.c patch and commit it? -=# Paul #=- PS: Uffda is the word a Swed would exclaim when examining the bottom of their shoe after stepping in a fresh cow-pie or after a similarly annoying event. --=-j9HshHCZXjpR1vlhBAD/ Content-Disposition: attachment; filename=loader_break.diff Content-Type: text/x-patch; name=loader_break.diff; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 3280 2006-05-25 Paul Gilliam wordsize); + + return get_target_memory_unsigned (targ, addr, + gdbarch_tdep (current_gdbarch)->wordsize); } --=-j9HshHCZXjpR1vlhBAD/--