From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8530 invoked by alias); 1 Dec 2010 23:03:55 -0000 Received: (qmail 8513 invoked by uid 22791); 1 Dec 2010 23:03:54 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Wed, 01 Dec 2010 23:03:48 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB1N3kdL009906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Dec 2010 18:03:46 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB1N3f2k024915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Dec 2010 18:03:45 -0500 Received: from host0.dyn.jankratochvil.net (host0.dyn.jankratochvil.net [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oB1N3ec1009044; Thu, 2 Dec 2010 00:03:40 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oB1N3dI0009030; Thu, 2 Dec 2010 00:03:39 +0100 Date: Wed, 01 Dec 2010 23:03:00 -0000 From: Jan Kratochvil To: Kevin Buettner Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Limit attempts to place breakpoints on _start, __start, and main in solib-svr4.c Message-ID: <20101201230339.GA8453@host0.dyn.jankratochvil.net> References: <20101129160233.1265d555@mesquite.lan> <20101130000707.GA26969@host0.dyn.jankratochvil.net> <20101130180618.66003c99@mesquite.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101130180618.66003c99@mesquite.lan> 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: 2010-12/txt/msg00010.txt.bz2 On Wed, 01 Dec 2010 02:06:18 +0100, Kevin Buettner wrote: > My testing shows that use of `! current_inferior ()->attach_flag' as > the test in enable_break() works when attaching to a process started > natively. I also see the correct behavior (in which a breakpoint is > placed on _start, et al) when the process is started via GDB's > "run" command. > > The case that doesn't work - and, unfortunately, it's the case that > really matters to me - is connecting to a remote target via "target > remote". GNU gdb (GDB) 7.2.50.20101201-cvs killall -9 gdbserver;sleep 1h&p=$!;sleep 0.1;./gdbserver/gdbserver :1234 ./pause& ./gdb -nx -ex 'file ./pause' -ex 'target remote localhost:1234' attach_flag=0 - correct killall -9 gdbserver;./pause&p=$!;sleep 0.1;./gdbserver/gdbserver --attach :1234 $p& ./gdb -nx -ex 'file ./pause' -ex 'target remote localhost:1234' attach_flag=1 - correct killall -9 gdbserver;./pause&p=$!;sleep 0.1;./gdbserver/gdbserver --multi :1234& ./gdb -nx -ex 'file ./pause' -ex 'target extended-remote localhost:1234' -ex "attach $p" attach_flag=1 - correct Probably in the first case you do not want to place those breakpoints? But I think at least the "main" breakpoint is the one requested by Mark Kettenis to stay there even in the case solib_break_names[] bpts fail: http://sourceware.org/ml/gdb-patches/2010-09/msg00313.html Maybe the single-hit variant would be enough? > The patch that I've posted does correctly handle the "target remote" > case. (It correctly handles the native cases too.) (The problem is it introduces two variants of "attach_flag".) Thanks, Jan