Debugger can't find source files
jbb
jbb at kdevelop.org
Fri Apr 25 13:26:03 UTC 2003
On Fri, 25 Apr 2003 08:50, Eric Sorensen wrote:
> > > I recently compiled Gideon from CVS, and now I'm having trouble adding
> > > breakpoints to my source files.
> > >
> > > The debugger console tells me that the file does not exist:
> > > (gdb) break epan.cpp:1284
> > > No source file named epan.cpp.
> > >
> > > I suppose it should be epan/epan.cpp:1284 as epan is my source
> > > directory... it's strange because I finally got Gideon to realise that
> > > the executable was locatede in this directory, but now the debugger
> > > doesn't get it...
> >
> > Examining deeper I have found that a standard project made from scratch
> > does debug correctly, but my old project won't. From the source dir I can
> > do a gdb on the executable and add a breakpoint at line 1 in the newly
> > created project... however gdb won't recognize my source files for the
> > other project? I'm thinking it has something to do with the compilation?
> >
> > Any help is appreciated, thanks in advance
>
> I'm kindof a newbie at C++ but had the same problem last week. This
> problem appeared on my computer because I named my class with capital
> letters but the filename all small. I didn't go into detail on the problem
> and just converted everything everywhere to lowercase (file names and class
> names). Then it worked.
>
> The problem lies in the capitalisation somewhere.
That's very strange as I have lower case filenamess and mixed case classes and
it works fine here.
I believe the most probably cause in both cases is that debug symbols have not
been compiled in. Perhaps whan switching to alpha4 a re-configure of your
project happened which turned off debug symbols for any file you subsequently
compiled (just plucking thoughts from the air here, I'm afraid :-) If it's a
kdevelop project make sure it's configured with --enable-debug=yes. Try a
distclean, configure etc and this should fix the problem.
The "No source file" message could well be correct if the file was in a
library that hasn't been loaded, so it might or might not be a symptom of the
problem.
Also, gdb has some bugs - particularly in it's C++ support. Sometimes it pays
to dust of the command line gdb and try that, to confirm if the problem lies
in kdevelop or not. I see you've done that Simon :-)
All I can say is debugging has never been easy. :-)) Let us know how you
progress with this.
Good luck.
jbb
More information about the KDevelop-devel
mailing list