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

Mr. Awesome

  • Guest
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" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
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: 4315
    • 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: 5490
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: 4315
    • 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: 5490
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
> 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" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
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: 4315
    • 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
> 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.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
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: 5490
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. ;-)

Mr. Awesome

  • Guest
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
> 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.