News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Wrong directory search in debugger

Started by von.hake, February 15, 2012, 06:25:21 PM

Previous topic - Next topic

von.hake

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.

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:

/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.

oBFusCATed

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).
(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!]

von.hake

thank you.
1) fixed
2) not fixed, but seems to be a project-related issue. i'll try to figure it out.

oBFusCATed

Hm, what is the exact command you call "step over", because we don't have such command?
(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!]

von.hake

#4
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.