From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10121 invoked by alias); 12 Apr 2005 12:59:34 -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 10099 invoked from network); 12 Apr 2005 12:59:27 -0000 Received: from unknown (HELO post.ift.uib.no) (129.177.40.40) by sourceware.org with SMTP; 12 Apr 2005 12:59:27 -0000 Received: from termo1.fi.uib.no ([129.177.39.206] helo=termo1.fi.uib.no.ift.uib.no) by post.ift.uib.no with esmtp (Exim 3.36 #2) id 1DLKzD-0004xd-00 for gdb@sources.redhat.com; Tue, 12 Apr 2005 14:59:23 +0200 To: gdb@sources.redhat.com Subject: Re: Setting breakpoint in src file located in different directory References: <20050412120746.GB6951@nevyn.them.org> <20050412122148.GA7954@nevyn.them.org> From: Joakim Hove Date: Tue, 12 Apr 2005 12:59:00 -0000 In-Reply-To: <20050412122148.GA7954@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 12 Apr 2005 08:21:48 -0400") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-04/txt/msg00065.txt.bz2 Thanks again, > Yes, it is a bug. OK, very good I thought the behaviour I tried to achieve should be valid. > It will build and run fine from $HOME. Well, that was indeed a no-brainer. I have now installed and run version 6.3, however it does still not work (completely). Let me describe in somewhat more detail how my configuration is: o I have a directory ~/libdos/src/ which contains many different source files. These files are compiled and linked to a shared library. o I have a directory ~/Apps/src which contains the src file "App.c" for this particular application. This source is linked with the shared library listed above to make an executable. The executable "App.x" is left in this directory. The program runs as it should (i.e. there are no problems loading the shared library.) o I have a subdirectory ~/Apps/src/run from which the application is run. So, when starting the application I do bash% cd ~/Apps/src/run bash% ../App.x And this works fine. o When trying to debug the application I invoke gdb as: bash% ~/bin/gdb ../App.x Regarding breakpoints from ./.gdbinit I get the following behaviour: 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 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. It seems that there is lesser acceptance for pending breakpoints from the init file than from interactive definition. However, I do provide exact coordinates in the init file, so that *should* in my opinion be sufficient. Anyway - Thanks Joakim -- Joakim Hove hove AT ift uib no / Tlf: +47 (55 5)8 27 90 / Stabburveien 18 Fax: +47 (55 5)8 94 40 / N-5231 Paradis http://www.ift.uib.no/~hove/ / 55 91 28 18 / 92 68 57 04