Author Topic: Debugger can't find project files  (Read 11956 times)

Offline Mr. Awesome

  • Multiple posting newcomer
  • *
  • Posts: 20
Debugger can't find project files
« 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?

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Debugger can't find project files
« Reply #1 on: December 31, 2005, 09:14:32 am »
You need to use GDB 6.3 instead of 5.x
78 280Z, "a few bolt-ons" - [email protected]
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #2 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)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger can't find project files
« Reply #3 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.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #4 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]
« Last Edit: December 31, 2005, 10:09:18 am by killerbot »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger can't find project files
« Reply #5 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.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #6 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 ??

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Debugger can't find project files
« Reply #7 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: [Select]
> 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
78 280Z, "a few bolt-ons" - [email protected]
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #8 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger can't find project files
« Reply #9 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:
Be patient!
This bug will be fixed soon...

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Debugger can't find project files
« Reply #10 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: [Select]
> 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: [Select]
Breakpoint 1 (D:/Devel/codeblocks/src/sdk/editormanager.cpp:2340) pending.
78 280Z, "a few bolt-ons" - [email protected]
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #11 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 ??

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #12 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. ;-)

Offline Mr. Awesome

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger can't find project files
« Reply #13 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: [Select]
> 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.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Debugger can't find project files
« Reply #14 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?
Life would be so much easier if we could just look at the source code.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger can't find project files
« Reply #15 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...
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #16 on: December 31, 2005, 01:25:39 pm »
Thanks Yiannis,
now I understand.
Yes yes, learned something today ;-)

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Debugger can't find project files
« Reply #17 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?)

Offline Mr. Awesome

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger can't find project files
« Reply #18 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?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Debugger can't find project files
« Reply #19 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger can't find project files
« Reply #20 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...
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugger can't find project files
« Reply #21 on: January 01, 2006, 06:18:52 pm »
Therion and Ceniza provide C::B SVN binary snapshots for windows. You can also look at this post to know when a new binary snapshot would be available.

Michael

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Debugger can't find project files
« Reply #22 on: January 05, 2006, 11:10:08 pm »
Finally, GDB 6.3.2 has been released, and it does support win98.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugger can't find project files
« Reply #23 on: January 05, 2006, 11:15:02 pm »
Finally, GDB 6.3.2 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

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Debugger can't find project files
« Reply #24 on: January 05, 2006, 11:21:28 pm »
6.3.2 or 6.3-2? :)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Debugger can't find project files
« Reply #25 on: January 05, 2006, 11:21:48 pm »
erm... 6.3-2 :P i think