From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24688 invoked by alias); 10 Oct 2005 16:46:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24629 invoked by uid 22791); 10 Oct 2005 16:46:03 -0000 Received: from eastrmmtao02.cox.net (HELO eastrmmtao02.cox.net) (68.230.240.37) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 10 Oct 2005 16:46:03 +0000 Received: from white ([68.9.64.121]) by eastrmmtao02.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051010164545.FYSW22723.eastrmmtao02.cox.net@white>; Mon, 10 Oct 2005 12:45:45 -0400 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EP0mW-00018l-00; Mon, 10 Oct 2005 12:45:44 -0400 Date: Mon, 10 Oct 2005 16:46:00 -0000 From: Bob Rossi To: Craig Jeffree Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com, Elena Zannoni Subject: Re: [PATCH] Relative source file search Message-ID: <20051010164543.GA3963@white> Mail-Followup-To: Craig Jeffree , Daniel Jacobowitz , gdb-patches@sources.redhat.com, Elena Zannoni References: <1127806796.32709.17.camel@norman> <1128389039.32709.128.camel@norman> <20051004013535.GA24000@nevyn.them.org> <1128560230.18954.14.camel@norman> <20051006021548.GA5232@white> <1128566917.18954.39.camel@norman> <20051006130035.GA6184@white> <1128641520.18954.63.camel@norman> <20051007002522.GA7444@white> <1128920165.25000.56.camel@norman> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1128920165.25000.56.camel@norman> User-Agent: Mutt/1.5.9i X-SW-Source: 2005-10/txt/msg00094.txt.bz2 On Mon, Oct 10, 2005 at 02:56:04PM +1000, Craig Jeffree wrote: > On Thu, 2005-10-06 at 20:25 -0400, Bob Rossi wrote: > > Craig, you should be able to put your patch into > > source.c:find_and_open_source in the part where it checks for > > if (dirname != NULL) > > { > > ... > > } > > > > instead of appending to the source_path, simply change the filename and > > leave the source_path alone. Run this through the testsuite, are there > > any errors? > > Attached is a new patch with the change in find_and_open_source. I > haven't had any luck with the testsuite though, I kept getting a build > error, then I did a cvs update to make sure I had the latest, now the > whole thing won't build. Does the cvs head build today? I'm getting > > make[4]: Entering directory `/staff/cjeffree/gdb/gdb-cvs/src/opcodes/po' > make[4]: *** No rule to make target `ga.po', needed by `ga.gmo'. Stop. I'm don't get this error, so I can't help you there. If it helps, I check out GDB like this, cvs -d ':ext:username@sources.redhat.com:/cvs/src' co gdb+dejagnu I ran this through the testsuite, and everything looks good. Below is the only notable differences, hopefully someone else can elaborate on them. Also, this change got my example working with a header file having an inline in a relative search directory. The GDB on my system does not find the header file, but it does after your patch. (This is of after adding the directory of the original executable location with the 'dir' command). AFAIK, this patch seems good. The last problem is to find out why sometimes the dirname is relative and the filename isn't, OR the filename is relative and the dirname isn't. Elena Zannoni is the general symtab maintainer, and probably knows a good deal about this. Hopefully, she'll let us know if she thinks this is an OK patch. I'd hate to have the patch accepted simply because it's working by coincidence. Finally, this patch seems to fix GDB when the dirname is relative to the executable. What about when the dirname is relative and is linked into a library? Then the library (from another directory) is linked into the executable? Does that example continue to work? Thanks, Bob Rossi --- original/objdir/gdb/testsuite/gdb.sum 2005-10-10 07:07:17.000000000 -0400 +++ path/builddir/gdb/testsuite/gdb.sum 2005-10-10 07:03:42.000000000 -0400 @@ -1,4 +1,4 @@ -Test Run By bob on Mon Oct 10 06:56:48 2005 +Test Run By bob on Mon Oct 10 06:52:26 2005 Native configuration is i686-pc-linux-gnu === gdb tests === @@ -9202,15 +9202,24 @@ PASS: gdb.gdb/selftest.exp: set listsize to 1 PASS: gdb.gdb/selftest.exp: run until breakpoint at captured_main PASS: gdb.gdb/selftest.exp: printed version as string +PASS: gdb.gdb/selftest.exp: step over context initialization PASS: gdb.gdb/selftest.exp: step over argc initialization PASS: gdb.gdb/selftest.exp: step over argv initialization +PASS: gdb.gdb/selftest.exp: step over symarg initialization +PASS: gdb.gdb/selftest.exp: step over execarg initialization +PASS: gdb.gdb/selftest.exp: step over corearg initialization +PASS: gdb.gdb/selftest.exp: step over cdarg initialization +PASS: gdb.gdb/selftest.exp: step over ttyarg initialization PASS: gdb.gdb/selftest.exp: next over get_run_time and everything it calls PASS: gdb.gdb/selftest.exp: next over setlocale LC_MESSAGES PASS: gdb.gdb/selftest.exp: next over setlocale LC_CTYPE PASS: gdb.gdb/selftest.exp: next over bindtextdomain PASS: gdb.gdb/selftest.exp: next over textdomain PACKAGE PASS: gdb.gdb/selftest.exp: next over lim_at_start initialization +PASS: gdb.gdb/selftest.exp: step over cmdsize initialization PASS: gdb.gdb/selftest.exp: next over cmdarg initialization via xmalloc +PASS: gdb.gdb/selftest.exp: next over ncmd initialization +PASS: gdb.gdb/selftest.exp: next over dirsize initialization PASS: gdb.gdb/selftest.exp: print a string PASS: gdb.gdb/selftest.exp: step into xmalloc call PASS: gdb.gdb/selftest.exp: xgdb is at prompt @@ -11173,7 +11184,7 @@ PASS: gdb.threads/watchthreads.exp: watch args[1] FAIL: gdb.threads/watchthreads.exp: threaded watch loop PASS: gdb.threads/watchthreads.exp: first watchpoint on args[0] hit -PASS: gdb.threads/watchthreads.exp: first watchpoint on args[1] hit +FAIL: gdb.threads/watchthreads.exp: first watchpoint on args[1] hit FAIL: gdb.threads/watchthreads.exp: watchpoint on args[0] hit in thread FAIL: gdb.threads/watchthreads.exp: watchpoint on args[1] hit in thread FAIL: gdb.threads/watchthreads.exp: combination of threaded watchpoints = 30 @@ -11318,13 +11329,13 @@ === gdb Summary === -# of expected passes 10701 -# of unexpected failures 161 +# of expected passes 10713 +# of unexpected failures 160 # of unexpected successes 1 # of expected failures 41 # of unknown successes 4 # of known failures 42 # of untested testcases 7 # of unsupported tests 6 -/home/bob/cvs/gdb/original/objdir/gdb/testsuite/../../gdb/gdb version 6.3.50.20051010-cvs -nx +/home/bob/cvs/gdb/path/builddir/gdb/testsuite/../../gdb/gdb version 6.3.50.20051010-cvs -nx