Author Topic: C::B / CYGWIN / gdb / No stop at breakpoints  (Read 12499 times)

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
C::B / CYGWIN / gdb / No stop at breakpoints
« on: August 29, 2012, 11:57:24 am »
Hello and thank you for reading my post.

Here is my problem.
- My OS is "Win7".
- I'm using "C::B 10.05".
- I have "CYGWIN" installed on my computer.
- I chose to use the CYGWIN's compiler, linker and debbuger along with "C::B".
- I created a basic "Hello World" "Console Application" and toggled a breakpoint:
so normally, I would expect the program to stop before printing "Hello World" on the console
and after I hit "F7", it would print it etc.
No such a thing happens.

I can properly build and run my program but I can't debug it: it doesn't stop at breakpoints.

In the "Debbuger" tab, I get such messages as:
(My "C::B" workspace directory is D:\some\directory\in\my\filesystem\cbproject\)
Code
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5.50.20120815-cvs (cygwin-special)
Warning: /cygdrive/d/some/directory/in/my/filesystem/cbproject/D: No such file or directory.

At /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream:77
Cannot open file: D:\some\directory\in\my\filesystem\cbproject\->->\cygdrive\d\some\directory\in\my\filesystem\cbproject\main.cpp

How can I fix this problem?
It looks like a path isn't set properly...

Thank you for helping.
Best regards.

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #1 on: August 29, 2012, 01:55:03 pm »
This thread http://forums.codeblocks.org/index.php/topic,12212.0.html doesn't solve the problem for me, unfortunately.

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #2 on: August 30, 2012, 11:38:49 am »
In my system ("Win7"), the "cygpath.exe" command default setting is to print "Unix form of NAMEs (/cygdrive/c/winnt)"
instead of "Windows form of NAMEs (C:\WINNT)"...
... so maybe the problem comes from here.
For example:
Code
dos shell> cygpath C:\Users\lea
/cygdrive/c/Users/lea

dos shell> cygpath -w C:\Users\lea
C:\Users\lea

BR.

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #3 on: August 31, 2012, 12:26:07 pm »
I followed these instructions step by step:
http://wiki.codeblocks.org/index.php?title=Installing_Cygwin_Compiler
it doesn't work either.

BR.

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #4 on: August 31, 2012, 12:30:48 pm »
I there anything I could do in

"Settings"
-> "Compiler and debugger..."
-> "Debbuger settings"
-> "Debugger initialization commands"

?

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #5 on: August 31, 2012, 03:03:56 pm »
Switched to MinGW.

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #6 on: August 31, 2012, 04:19:21 pm »
I don't use cygwin, here is my suggestion:

To use cygwin-gdb, you may need to hack the source code of debugger plugin, especially the file path handling, you should convert the cygwin style path to/back windows style. :)
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 Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: C::B / CYGWIN / gdb / No stop at breakpoints
« Reply #7 on: September 03, 2012, 10:06:12 am »
Thank you for your answer. I'm sorry: I've no time for this, I'm just a simple user.
Best regards.
BTW: this thread made me decide to switch to "MinGW" (which I knew was working on my previous computer):
http://forums.codeblocks.org/index.php/topic,15852.0.html