Author Topic: GDB problem  (Read 5450 times)

Offline ennom

  • Single posting newcomer
  • *
  • Posts: 5
GDB problem
« on: June 05, 2010, 07:22:12 pm »
Hi there!
First of all - i'm newbie in cb, cygwin and gdb. Just downloaded cb to try out. I wrote a little program to see how it going in cb. I have problem with gdb(or cb? or cygwin? or with all of them? :)) when trying to stop at breakpoint -
Quote
Cannot open file: C:\src\cb_test\cb_test\->->\cygdrive\c\src\cb_test\cb_test\main.cpp
At /cygdrive/c/src/cb_test/cb_test/main.cpp:26
any ideas?
gdb is GNU gdb 6.8.0.20080328
cb is 10.05
cygwin is CYGWIN_NT-6.1-WOW64
thank u!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: GDB problem
« Reply #1 on: June 05, 2010, 11:11:13 pm »
(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 ennom

  • Single posting newcomer
  • *
  • Posts: 5
Re: GDB problem
« Reply #2 on: June 06, 2010, 08:47:53 am »
Here is how gdb output looks like. There are no any whitespaces in my path. I suppose that two rectangles in path are two "right arrow" chars, but i'm lack of appropriate font.

[attachment deleted by admin]
« Last Edit: June 06, 2010, 08:49:31 am by ennom »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GDB problem
« Reply #3 on: June 06, 2010, 09:16:05 am »
Look: the gdb can't find the source file located by \cygdrive\XXXX

I guess your compiler is cygwin gcc, but your debugger is native gdb. So, they are not compatible.
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 ennom

  • Single posting newcomer
  • *
  • Posts: 5
Re: GDB problem
« Reply #4 on: June 06, 2010, 09:32:32 am »
but your debugger is native gdb
Yeah, compiler is cygwin gcc, but what do you mean 'native'? The only gdb i have is from cygwin, how then it can be incompatible with the compiler?

btw, thank you all guys.

Offline ennom

  • Single posting newcomer
  • *
  • Posts: 5
Re: GDB problem
« Reply #5 on: June 06, 2010, 09:37:18 am »
and i'm able to see programs text using 'l' command in gdb:

[attachment deleted by admin]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: GDB problem
« Reply #6 on: June 06, 2010, 10:33:44 am »
Do you really have right-arrow chars in your path ?
Try it with no special chars in path, this can always be the cause for such issues.

Offline ennom

  • Single posting newcomer
  • *
  • Posts: 5
Re: GDB problem
« Reply #7 on: June 06, 2010, 10:50:34 am »
No, i don't have any arrows in path. Path to program code is c:\src\cb_test\cb_test\main.cpp.  I don't know what this mean('@' is placeholder here for char with code 0x1a -i'm unable to print it here, look to pic at my 2-nd post)
Quote
Cannot open file: C:\src\cb_test\cb_test\@@\cygdrive\c\src\cb_test\cb_test\main.cpp
At @@/cygdrive/c/src/cb_test/cb_test/main.cpp:26
but this is how cb shows problem in gdb.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: GDB problem
« Reply #8 on: June 06, 2010, 12:26:50 pm »
Looks like the compiler has embedded the paths to the sources in a wrong way.
(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!]