From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31700 invoked by alias); 8 Jun 2012 13:45:39 -0000 Received: (qmail 31687 invoked by uid 22791); 8 Jun 2012 13:45:37 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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, 08 Jun 2012 13:45:21 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q58DjHWf005711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Jun 2012 09:45:17 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q58DjFuW011289; Fri, 8 Jun 2012 09:45:15 -0400 Message-ID: <4FD201EA.6010509@redhat.com> Date: Fri, 08 Jun 2012 13:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Mark Kettenis CC: jan.kratochvil@redhat.com, macro@codesourcery.com, Joakim.Tjernlund@transmode.se, gdb-patches@sourceware.org Subject: Re: [PATCH] solib-svr4: Avoid unwanted shlib internal BPs When debugging Linux kernel or u-boot References: <1338562868-22411-1-git-send-email-Joakim.Tjernlund@transmode.se> <4FC8EC08.1060609@redhat.com> <20120601172214.GA21236@host2.jankratochvil.net> <4FC8FDD2.7060407@redhat.com> <4FD1EB8C.1050407@redhat.com> <20120608123847.GA13337@host2.jankratochvil.net> <4FD1F902.5000705@redhat.com> <201206081336.q58Dar6Y019154@glazunov.sibelius.xs4all.nl> In-Reply-To: <201206081336.q58Dar6Y019154@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg00230.txt.bz2 On 06/08/2012 02:36 PM, Mark Kettenis wrote: >> Date: Fri, 08 Jun 2012 14:07:14 +0100 >> From: Pedro Alves >> >> On 06/08/2012 01:38 PM, Jan Kratochvil wrote: >>> I still do not see why 'main' was not left there as it would not hurt and it >>> could help. >> >> The original patch was trivial, and a one liner. I preferred not >> requiring bigger changes and risk needing to require copyright >> assignment for that patch. Then, GDB has not been trapping on >> "main", but on "_start" for static binaries for a long time, so that >> even feels like a separate "feature" to me. > > The problem here is that "_start" is by no means a standardized name, > whereas "main" is (although there are some exceptions). Yes, I've mentioned that myself in this thread. The solution is then to set the breakpoint at the elf's entry point, not "_start" literally. >> I even feel like we could/should drop the "_start/main" fallback >> from svr4 handling. It's just historic at this point, as far as I >> could ascertain. If those are really needed on some system, then a >> comment in the code mentioning such system is warranted. > > Please don't do this. The fallback is useful when bringing up GDB on > a new platform that decided to use yet another name for the ld.so > state point "function". Oh come on, for bring up, just hack GDB and add "main" or whatever until you fix things properly. ;-) > Or in other cases where for some reason > placing breakpoints in ld.so doesn't work but putting them in the > executable itself does work. I've been in that situation at least a > couple of times in the past couple of years. Okay, that'd be for dynamically linked executables. I'd buy this, but I'd love to hear more about it. The current fallback still leaves dlopen out in this case. -- Pedro Alves