This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Filename with "./" in breakpoint command
- From: Bob Rossi <bob at brasko dot net>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Sat, 3 Dec 2005 09:18:59 -0500
- Subject: Re: Filename with "./" in breakpoint command
- References: <dms4je$qit$1@sea.gmane.org>
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