Author Topic: Debugger cannot open files  (Read 16548 times)

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Debugger cannot open files
« on: November 19, 2009, 02:00:49 pm »
Hi,

When I use the debugger in codeblocks, and I want to open the functions of the stack, I get something like this:

Cannot open file: C:\prog\src\common\event.cpp
Cannot open file: C:\prog\src\common\event.cpp
Cannot open file: C:\prog\src\msw\frame.cpp
Cannot open file: C:\prog\src\msw\window.cpp

Is there something wrong with my debugger settings?

Thanks...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Debugger cannot open files
« Reply #1 on: November 19, 2009, 02:21:27 pm »
Is there something wrong with my debugger settings?
Probably not. But definitely something is wrong with your posting.
What platform, OS, what C::B version, what compiler (version), what debugger (version), please?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #2 on: November 19, 2009, 02:31:58 pm »
Sorry.
Here is more info:

Windows XP
CodeBlocks Nightly Build 5911 (the latest one)
Mingw GDB debugger 6.3.2

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #3 on: November 19, 2009, 03:31:12 pm »
So if I want to open the location (doubleclick on the entry on the stack), it wants to open the cpp files at the wrong directery.
It searches in my project directory: c:\prog, in stead of the directory of the wxwidgets cpp files.

How can I change this?
I already tried to add the wxWidgets directory to "Additional Debugger Search Dirs". But doesn't help.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Debugger cannot open files
« Reply #4 on: November 19, 2009, 03:55:09 pm »
Please update to gdb 6.8 or 7.0+ 6.3 is quite old!!!!!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #5 on: November 19, 2009, 04:25:34 pm »
Please update to gdb 6.8 or 7.0+ 6.3 is quite old!!!!!

Still the same problem.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger cannot open files
« Reply #6 on: November 19, 2009, 04:51:37 pm »
It seems you want to step into the wxwidget library(debug version). My question is: How do you build your wxWidget library?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #7 on: November 19, 2009, 05:11:36 pm »
It seems you want to step into the wxwidget library(debug version). My question is: How do you build your wxWidget library?

Something likes this:
mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
and
mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1

I have used them, and they work. Don't have any compiler errors either, but my program crashes.
So, I want to debug. But I get the error that they can't find the files. (debugger searches in the wrong directory)


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger cannot open files
« Reply #8 on: November 19, 2009, 05:23:15 pm »
Some months ago, I used the wxPack, then I can't debug into the wxWidget's source code.

See my post:
how to debug into wxwidget source code?
report the Debugger problem about the tracking into wxWidgets source

I guess this is a issue about the path problem.
You should use the "absolute path" to build your project.

Check this option: settings->compiler and debugger settings-> advanced compiler options -> use full path for source files




If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #9 on: November 20, 2009, 09:57:39 am »
Some months ago, I used the wxPack, then I can't debug into the wxWidget's source code.

See my post:
how to debug into wxwidget source code?
report the Debugger problem about the tracking into wxWidgets source

I guess this is a issue about the path problem.
You should use the "absolute path" to build your project.

Check this option: settings->compiler and debugger settings-> advanced compiler options -> use full path for source files

Good to see I'm not alone with this problem.
So the only solution this far is to have your project in the samples directory of wxWidgets.


Or are you saying that with using an absolute path, it can be solved too?
I can find: settings->compiler and debugger...
But then I can't find the "advanced compiler options"; and neither "use full path for source files".











Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger cannot open files
« Reply #10 on: November 20, 2009, 02:31:44 pm »

Or are you saying that with using an absolute path, it can be solved too?

But then I can't find the "advanced compiler options"; and neither "use full path for source files".


Yes, the problem was solved.
The "advanced compiler options" is a button in the right bottom.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Debugger cannot open files
« Reply #11 on: November 20, 2009, 02:44:54 pm »
The "advanced compiler options" is a button in the right bottom.

To be more precisely it's called "Advanced options" and you can find it at: "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings" ( the rightmost tab).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger cannot open files
« Reply #12 on: November 20, 2009, 03:03:43 pm »
Ok, it's here. see the image.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline carrejans

  • Single posting newcomer
  • *
  • Posts: 9
Re: Debugger cannot open files
« Reply #13 on: November 20, 2009, 03:27:50 pm »
After clicking "Advanced Options...".
Is it the last checkbox (see my attachment)?
It was already checked.  :?

[attachment deleted by admin]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger cannot open files
« Reply #14 on: November 20, 2009, 04:57:33 pm »
After clicking "Advanced Options...".
Is it the last checkbox (see my attachment)?
It was already checked.  :?

yes, you are right.

In my system(Windows XP), I can debug into the wxWdigets source.

Note: I'm not sure how you build wx Debug library. When building the library, you also need to use the "full path" option.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.