Author Topic: Wrong directory search in debugger  (Read 3685 times)

Offline von.hake

  • Multiple posting newcomer
  • *
  • Posts: 16
Wrong directory search in debugger
« 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.
« Last Edit: February 16, 2012, 08:33:43 am by von.hake »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Wrong directory search in debugger
« Reply #1 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).
(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 von.hake

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Wrong directory search in debugger
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Wrong directory search in debugger
« Reply #3 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?
(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 von.hake

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Wrong directory search in debugger
« Reply #4 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.
« Last Edit: February 16, 2012, 08:34:23 am by von.hake »