From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6072 invoked by alias); 1 Jun 2012 18:05:19 -0000 Received: (qmail 6056 invoked by uid 22791); 1 Jun 2012 18:05:18 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jun 2012 18:05:04 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q51I4tos008439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Jun 2012 14:05:04 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q51HjSDL016590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 1 Jun 2012 13:45:30 -0400 Date: Fri, 01 Jun 2012 18:05:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Joakim Tjernlund , gdb-patches@sourceware.org Subject: Re: [PATCH] solib-svr4: Avoid unwanted shlib internal BPs When debugging Linux kernel or u-boot Message-ID: <20120601174527.GA968@host2.jankratochvil.net> References: <1338562868-22411-1-git-send-email-Joakim.Tjernlund@transmode.se> <4FC8EC08.1060609@redhat.com> <20120601172214.GA21236@host2.jankratochvil.net> <4FC8FDD2.7060407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FC8FDD2.7060407@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-06/txt/msg00025.txt.bz2 On Fri, 01 Jun 2012 19:37:22 +0200, Pedro Alves wrote: > Yeah, that's a really contrived example. You're relying on stopping at main, > not when the DSO is really loaded (_dl_debug_state) to set the breakpoint. > I can see _start not existing, with the entry point named something else, > but if you strip your static binary to miss _dl_debug_state, you won't get > main either. (and then static binaries that dlopen aren't something you'd > want to do normally.) I do not have to strip the binary to not have _dl_debug_state, there are many libc implementations out there and I guess they are not all compatible with the "_dl_debug_state" naming. I guess this is also the reason why GDB knows so many names for it: "r_debug_state", "_r_debug_state", "_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity", "_rtld_debug_state", And the goal of this non-ld.so breakpoint is that most of programs loads libraries only during its init, before main, therefore a breakpoint at "main" should catch them all. OTOH as I said current GDB will place the breakpoint to _start first and it will miss those libraries anyway. So it is not a regression. Also nowadays some 3rd party runtime probably more adapts to GDB than vice verse. Regards, Jan