From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13834 invoked by alias); 12 Apr 2005 13:04:33 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13509 invoked from network); 12 Apr 2005 13:04:11 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 12 Apr 2005 13:04:11 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DLL3q-0002fw-Bn; Tue, 12 Apr 2005 09:04:10 -0400 Date: Tue, 12 Apr 2005 13:04:00 -0000 From: Daniel Jacobowitz To: Joakim Hove Cc: gdb@sources.redhat.com Subject: Re: Setting breakpoint in src file located in different directory Message-ID: <20050412130410.GA10078@nevyn.them.org> Mail-Followup-To: Joakim Hove , gdb@sources.redhat.com References: <20050412120746.GB6951@nevyn.them.org> <20050412122148.GA7954@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00066.txt.bz2 On Tue, Apr 12, 2005 at 01:59:46PM +0200, Joakim Hove wrote: > o I have a directory ~/libdos/src/ which contains many different > source files. These files are compiled and linked to a shared > library. That's the key. Shared library. > 1: break /HOME/user/Apps/src/App.c:450 > > This corresponds to a situation where both the src file "App.c" > and the executable App.x are located in the same directory, > altough the execution is invoked from another directory. This > works in 6.3 and did not work in 6.1 Good. This is the bug which I thought was fixed. > 2: break /HOME/user/libdos/src/ehist.c:450 > > This is an attempt to set breakpoints in one of the files which > are located in a "third" directory, i.e. distrinct from both the > directory containing the executable and the execution > directory. This fails with: > > No source file named /home/fimm/cmu/hove/libdos/src/ehist.c. > > > 3: If you to try set the breakpoint indicated in above manually from > within gdb I get the following behaviour: > > bash% ~/bin/gdb ../App.x > <....> > (gdb) break /HOME/user/libdos/src/ehist.c:450 > > No source file named /home/fimm/cmu/hove/libdos/src/ehist.c. > Make breakpoint pending on future shared library load? (y or [n]) > > Well, answering yes to this and then starting the program with: > > (gdb) run arg1 arg2 ... > Breakpoint 4 at 0x2a95673dd0: file ehist.c, line 450. > Pending breakpoint "/home/fimm/cmu/hove/libdos/src/ehist.c:450" > resolved > > The pending breakpoint is immediately resolved, and everything > works correctly. See the [n]? The default answer to this question is no, because historically pending breakpoints were not available; this is the most consistent interface. If you want this to work from .gdbinit, see "help set breakpoint pending". The breakpoint can't be set yet, because the shared library has not yet been loaded. -- Daniel Jacobowitz CodeSourcery, LLC