Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: von.hake on February 15, 2012, 06:25:21 pm

Title: Wrong directory search in debugger
Post by: von.hake on February 15, 2012, 06:25:21 pm
Hi. I've got some troubles while setting up debugging  in C::B on Debian 6.
I build the project using a custom Makefile located at project/dir1/Makefile
The executable I'm running is  project/dir1/subdir1/subdir2/executable
The source file I'm debugging is at:

project/dir1/subdir1/subdir2/source.cpp

I start debugging process.

Code
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
all
Adding source dir: /home/user/projects/project/dir1
Adding source dir: /home/user/project/dir1/subdir1/
Adding source dir: /home/user/project/dir1/subdir1/subdir2
Adding source dir: /home/user/project/dir1
Adding source dir: /home/user/project/
Changing directory to: /home/user/project/dir1/subdir1/subdir2
Adding file: subdir1/subdir2/executable
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0.1-debian

Now the problem:

1. after clicking in the call stack jump to this file/frame i get in debugger window:

Cannot open file: /home/user/projecs/project/project/dir1/source.cpp
while the correct path would be /home/user/projecs/project/project/dir1/subdir1/subdir2/source.cpp.

Please note that I've added in additional debugger search dirs in Project/target options:

Code
/home/user/projecs/project/project/dir1/
/home/user/projecs/project/project/dir1/subdir1
/home/user/projecs/project/project/dir1/subdir1/subdir2

2. I have troubles with debugging itself. On some lines the "Next line" button doesn't make the step; the control doesn't go to the next line, but disappears. To get it back to the next line I have to press "Next line" like 10 more times. So I assume the debugger goes inside the function, but doesn't tell me anything about it. If I press next instruction at that time, I may end up somewhere in opt/gcc-4.4.3/lib/libstdc++.so.6 . I tried to use just command line gdb; the "n" command worked fine for me.

3. I've read that can be ignored, but still just in case it can still be relevant to 1) and 2). I get in Program Console :  warning: GDB: Failed to set controlling terminal: Operation not permitted

Thank you in advance.
Title: Re: Wrong directory search in debugger
Post by: oBFusCATed on February 15, 2012, 06:34:09 pm
I don't know what version of C::B you're using, but please try a debugger's branch nightly build (we have binaries for debian).
Title: Re: Wrong directory search in debugger
Post by: von.hake on February 15, 2012, 08:28:30 pm
thank you.
1) fixed
2) not fixed, but seems to be a project-related issue. i'll try to figure it out.
Title: Re: Wrong directory search in debugger
Post by: oBFusCATed on February 15, 2012, 10:02:25 pm
Hm, what is the exact command you call "step over", because we don't have such command?
Title: Re: Wrong directory search in debugger
Post by: von.hake on February 16, 2012, 08:31:41 am
Sorry for confusion;
I meant the <next line> command, as opposite to <step into>==step inside the function call;
I've corrected the original message.