From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21066 invoked by alias); 3 Dec 2005 14:19:22 -0000 Received: (qmail 21057 invoked by uid 22791); 3 Dec 2005 14:19:21 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao05.cox.net (HELO eastrmmtao05.cox.net) (68.230.240.34) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 03 Dec 2005 14:19:20 +0000 Received: from white ([68.9.65.164]) by eastrmmtao05.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051203141913.JZXY14098.eastrmmtao05.cox.net@white>; Sat, 3 Dec 2005 09:19:13 -0500 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EiYE7-0003db-00; Sat, 03 Dec 2005 09:18:59 -0500 Date: Sat, 03 Dec 2005 14:19:00 -0000 From: Bob Rossi To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Filename with "./" in breakpoint command Message-ID: <20051203141859.GB10592@white> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00037.txt.bz2 On Sat, Dec 03, 2005 at 03:55:10PM +0300, Vladimir Prus wrote: > > Hi, > I just got the following gdb session: > > $ ~/build/gdb-cvs/gdb/gdb tracepoints > GNU gdb 6.4.50.20051121-cvs > (gdb) b ./tracepoints.cpp:12 > No source file named ./tracepoints.cpp. > Breakpoint 1 (./tracepoints.cpp:12) pending. > (gdb) b tracepoints.cpp:12 > Breakpoint 2 at 0x80483c4: file tracepoints.cpp, line 12. > (gdb) quit > $ ls tracepoints.cpp > tracepoints.cpp > > It looks like leading "./" in file name confuses gdb. This "./" thing is > send by KDevelop in some cases. I'm about to fix on KDevelop side just to > make sure it works with gdb 6.4, but actually, this seems like a bug in > gdb. Say, I have two files called util.cpp -- one in current dir, and > another in some library. It's reasonable to use "./util.cpp" to refer to a > file in the current dir, no? So, is this a bug, and should I file it in the > tracker? For some reason, GDB doesn't seem to be forgiving with relative paths. I even tried ../dirname/tracepoints.cpp:12 and it doesn't work. There could be a good reason for this, but I dont know what it is. Why not give the absolute path when setting a breakpoint? That's what I do. This is pretty much guarenteed to work. Bob Rossi