From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2005 invoked by alias); 6 Jul 2006 01:01:34 -0000 Received: (qmail 1997 invoked by uid 22791); 6 Jul 2006 01:01:33 -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, 06 Jul 2006 01:01:29 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k6611RXG004443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 5 Jul 2006 21:01:27 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.6/NCO/VER7.0) with ESMTP id k6611n0Y181792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 5 Jul 2006 19:01:49 -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 k6611Qtu001095 for ; Wed, 5 Jul 2006 19:01:26 -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 k6611Q5P001088; Wed, 5 Jul 2006 19:01:26 -0600 Subject: Re: [patch] Fixes problem setting breakpoint in dynamic loader From: PAUL GILLIAM Reply-To: pgilliam@us.ibm.com To: Mark Kettenis Cc: gdb-patches@sources.redhat.com In-Reply-To: <200606172021.k5HKL82O013629@elgar.sibelius.xs4all.nl> References: <1148513171.315.104.camel@dufur.beaverton.ibm.com> <200606172021.k5HKL82O013629@elgar.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="=-CenXcrpS7QDPwIzPwBF9" Date: Thu, 06 Jul 2006 01:01:00 -0000 Message-Id: <1152143843.6282.49.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-07/txt/msg00019.txt.bz2 --=-CenXcrpS7QDPwIzPwBF9 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 2101 On Sat, 2006-06-17 at 22:21 +0200, Mark Kettenis wrote: > > From: PAUL GILLIAM > > Date: Wed, 24 May 2006 16:26:11 -0700 > > > > --=-z0a1QHXPsj5sKoA5562L > > Content-Type: text/plain > > Content-Transfer-Encoding: 7bit > > > > On PowerPC-64, with 64-bit executables, GDB has been giving this message > > for a while: > > > > warning: Unable to find dynamic linker breakpoint function. > > GDB will be unable to debug shared library initializers > > and track explicitly loaded dynamic code. > > > > This is because "enable_break()" in solib-svr4.c was looking for the > > symbol "._dl_debug_state" in the 64-bit dynamic loader and not finding > > it. This should not be a surprise because these 'dot' symbols have not > > been used for a while. > > Your patch removes "._dl_debug_state" from the list of symbols. > Doesn't this break debugging old binaries that still have the 'dot' > symbols? No. The non-'dot' symbol "_dl_debug_state" will either be found in a code segment or in a data segment. If found in a code segment, we can set the breakpoint at where ever the symbol points. If it points to a function descriptor that's OK because if it's in the code segment, a function descriptor consists of executable code and a breakpoint can be set there. If found in the data segment, then it must be a function descriptor and it just gets "dereferenced". So I am attaching a new patch that addresses most of your comments in http://sourceware.org/ml/gdb-patches/2006-06/msg00382.html and deletes the "._dl_debug_state" entry in the table. One thing not addressed is this: > Also, I don't mind that the comment was rearranged, but I would like > to see information regarding the two linker symbols retained in some > fashion. The two linker symbols issue is no longer relevant for this piece of code: the "._dl_debug_state" symbol was just a crutch used to avoid having to "dereference" the function descriptor pointed to by "_dl_debug_state", should it happen to be in a data section. Now there is code to do just that. OK to commit? --=-CenXcrpS7QDPwIzPwBF9 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: 3061 2006-07-04 Paul Gilliam wordsize); + + return get_target_memory_unsigned (targ, addr, + gdbarch_tdep (current_gdbarch)->wordsize); } --=-CenXcrpS7QDPwIzPwBF9--