Code::Blocks Forums

User forums => Help => Topic started by: Mr. Awesome on December 31, 2005, 09:11:47 am

Title: Debugger can't find project files
Post by: Mr. Awesome on December 31, 2005, 09:11:47 am
Whenever I try to debug my program, I get a message that says:

No source file named Player.cpp.

I am sure that Player.cpp is in my project correctly and in the same directory as everything else in the project.  What is wrong?
Title: Re: Debugger can't find project files
Post by: 280Z28 on December 31, 2005, 09:14:32 am
You need to use GDB 6.3 instead of 5.x
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 09:32:14 am
I also get those can't find messages, even with gdb 6.3 (I think 6.3.1)  (on windows)
Title: Re: Debugger can't find project files
Post by: mandrav on December 31, 2005, 09:36:31 am
I also get those can't find messages, even with gdb 6.3 (I think 6.3.1)  (on windows)

In that case, enable the debugger's debug log (Settings->Debugger) and post it here when the problem happens.
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 10:07:46 am
At first screenshot with the message in the codeblocks tab
And secundo : the dbug tab, not much in there.

[attachment deleted by admin]
Title: Re: Debugger can't find project files
Post by: mandrav on December 31, 2005, 10:10:30 am
Although this is not the debugger's debug log I asked for :), you can clearly see that the breakpoint is added as "pending" meaning it will be set when resolved (i.e. the DLL it resides in is loaded). This is normal.
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 10:11:51 am
Maybe it hase something to do with the forward slashes in the path ---> we are on windows here ??
Title: Re: Debugger can't find project files
Post by: 280Z28 on December 31, 2005, 10:13:43 am
OOhhh that's what it does. It can resolve pending breakpoints as they are encountered. You should see a "resolved" message when it is found.

GDB 5.x does not support pending breakpoints. That's why you need 6.3 :)

Code
> break D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340
No source file named D:/Devel/codeblocks/src/sdk/editormanager.cpp.
Breakpoint 1 (D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340) pending.
(gdb)
> run
Breakpoint 2 at 0x618331f4: file sdk/editormanager.cpp, line 2340.
Pending breakpoint "D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340" resolved
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 10:13:49 am
Yes, the breakpoint works , that's for sure. But strange someone is saying our file is not found -> confusing.
Debuggers log coming up.
Title: Re: Debugger can't find project files
Post by: mandrav on December 31, 2005, 10:16:40 am
Yes, the breakpoint works , that's for sure. But strange someone is saying our file is not found -> confusing.
Debuggers log coming up.

Well, that "someone" is GDB itself and I believe it's the most authoritative source to tell you so  :lol:
Title: Re: Debugger can't find project files
Post by: 280Z28 on December 31, 2005, 10:17:48 am
Yes, the breakpoint works , that's for sure. But strange someone is saying our file is not found -> confusing.
Debuggers log coming up.

Well GDB will always spit out that message before a pending breakpoint. Maybe the debugger plugin should recognize this output from GDB:

Code
> break D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340
No source file named D:/Devel/codeblocks/src/sdk/editormanager.cpp.
Breakpoint 1 (D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340) pending.

and transparently show just this to the user:

Code
Breakpoint 1 (D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340) pending.
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 10:22:53 am
Command-line: C:\Program Files\CodeBlocks\bin\gdb.exe -nx -fullname  -args devel/codeblocks.exe --debug-log --no-check-associations -ns
Working dir : C:\cb_snap\svn\src\
> set prompt (gdb)
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) (gdb)
> set confirm off
(gdb)
> set width 0
(gdb)
> set height 0
(gdb)
> set breakpoint pending on
(gdb)
> set print asm-demangle on
(gdb)
> set disassembly-flavor intel
(gdb)
> cd devel
(gdb)
> directory C:/cb_snap/svn/src/
(gdb)
> delete
(gdb)
> break C:/cb_snap/svn/src/sdk/projectfileoptionsdlg.cpp:97
No source file named C:/cb_snap/svn/src/sdk/projectfileoptionsdlg.cpp.
Breakpoint 1 (C:/cb_snap/svn/src/sdk/projectfileoptionsdlg.cpp:97) pending.
(gdb)
> run
Breakpoint 2 at 0x6057736a: file sdk/projectfileoptionsdlg.cpp, line 97.
Pending breakpoint "C:/cb_snap/svn/src/sdk/projectfileoptionsdlg.cpp:97" resolved


This is the output, strange I have 2 breakpoints now ??
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 10:28:07 am
I just tried it out also on a little project (just a main.cpp), there it is OK.
So it seems it the sources are in another dll or something else (what's else), it happens.

So if it is a bug in GDB, maybe Sam's suggestion to filter it out is a good idea (less confusion for the user), since user perception is an dangerous thing. If you tell clients well, it 's complaining but it works fine, they don't trust you. ;-)
Title: Re: Debugger can't find project files
Post by: Mr. Awesome on December 31, 2005, 10:35:06 am
I'm getting kind of lost in this discussion, but here is the debug log that I'm getting (BTW I do have GDB 6.3):

Code
> directory C:/C__PRO~1/AIGAME~1/Race/
> file Race.exe
> delete
> break Player.cpp:61
> set confirm off
> set disassembly-flavor intel
> run
pre-prompt
prompt
post-prompt
pre-prompt
prompt
post-prompt
breakpoints-invalid
error-begin
No source file named Player.cpp.
frames-invalid
pre-prompt
prompt
post-prompt
pre-prompt
prompt
post-prompt
error
pre-prompt
prompt
post-prompt
pre-prompt
prompt
post-prompt
pre-prompt
prompt
post-prompt
frames-invalid
<snip about 20 frames-invalid>
starting
frames-invalid
<snip maybe 60 frames-invalid>
exited 0
> quit
frames-invalid
stopped
pre-prompt
prompt
post-prompt

I don't know if this helps or what, like I said I'm lost.  If you find a solution, please tell me what I need to do.  Thanks for any help.
Title: Re: Debugger can't find project files
Post by: yop on December 31, 2005, 01:15:45 pm
So if it is a bug in GDB, maybe Sam's suggestion to filter it out is a good idea (less confusion for the user), since user perception is an dangerous thing. If you tell clients well, it 's complaining but it works fine, they don't trust you. ;-)
Sorry I won't agree on that, IMHO the gdb user should know what the debuger outputs (if you present him with this option) and have the output intact, or at least give him the option to view it (like the debugger output cb has now). Also secondly how can you filter out a so commonly used message (No source file...) from gdb?
Title: Re: Debugger can't find project files
Post by: mandrav on December 31, 2005, 01:18:09 pm
So if it is a bug in GDB, maybe Sam's suggestion to filter it out is a good idea (less confusion for the user), since user perception is an dangerous thing. If you tell clients well, it 's complaining but it works fine, they don't trust you. ;-)

Lieven, it is not a bug. The debugger is telling you that there is no such file in codeblocks.exe and adds a pending breakpoint. When the DLL that contains that file loads, it will tell you it found it (resolved).
There is no confusion for the user here. It tells you it can't find it and on the next line it tells you it has been added as "pending".

I'm getting kind of lost in this discussion, but here is the debug log that I'm getting (BTW I do have GDB 6.3):

You 're using RC2 or earlier. The debugger has been greatly improved since then...
Title: Re: Debugger can't find project files
Post by: killerbot on December 31, 2005, 01:25:39 pm
Thanks Yiannis,
now I understand.
Yes yes, learned something today ;-)
Title: Re: Debugger can't find project files
Post by: duncanka on January 01, 2006, 03:11:43 am
You need to use GDB 6.3 instead of 5.x
Question: GDB 6.3 is not supported on Windows 98.  Is there any way to fully support both, perhaps, or do a system-dependent check, or maybe even just check the executable or its output, so that Windows 98 users are not left weeping in the dust?
Or failing that...does anyone know where you can get that psapi.dll file that 98 doesn't have?
(Or am I misunderstanding, and we should just leave it at saying that some minor features are unsupported by 98?)
Title: Re: Debugger can't find project files
Post by: Mr. Awesome on January 01, 2006, 09:11:35 am
You 're using RC2 or earlier. The debugger has been greatly improved since then...

Sorry to be ignorant, but I don't know what RC2 means.  What do I need to do to allow me to debug my project?
Title: Re: Debugger can't find project files
Post by: killerbot on January 01, 2006, 09:45:35 am
RC2 : this is release candidate 2, the last offical released version of Cb at the 25th october 2005.
But code has been changed since that day, no official release yet, you can get the code out of the svnrepository and build it yourself. That code contains much bug fixes, new features, improvements.

Lieven
Title: Re: Debugger can't find project files
Post by: mandrav on January 01, 2006, 10:22:30 am
Or you could search the forum for unofficial SVN builds. A couple of people are providing binary snapshots of the SVN version...
Title: Re: Debugger can't find project files
Post by: Michael on January 01, 2006, 06:18:52 pm
Therion (http://paginas.terra.com.br/informatica/mauricio/codeblocks/) and Ceniza (http://gda.utp.edu.co/~ceniza/CodeBlocks/) provide C::B SVN binary snapshots for windows. You can also look at this post (http://forums.codeblocks.org/index.php?topic=1372.0) to know when a new binary snapshot would be available.

Michael
Title: Re: Debugger can't find project files
Post by: rickg22 on January 05, 2006, 11:10:08 pm
Finally, GDB 6.3.2 (http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download) has been released, and it does support win98.
Title: Re: Debugger can't find project files
Post by: Michael on January 05, 2006, 11:15:02 pm
Finally, GDB 6.3.2 (http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download) has been released, and it does support win98.

This is a good new :). It means that it would be possible (AFAIK) to provide an ANSI build of C::B for Win98.

Michael
Title: Re: Debugger can't find project files
Post by: Ceniza on January 05, 2006, 11:21:28 pm
6.3.2 or 6.3-2? :)
Title: Re: Debugger can't find project files
Post by: rickg22 on January 05, 2006, 11:21:48 pm
erm... 6.3-2 :P i think