This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Filename with "./" in breakpoint command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]