Author Topic: set breakpoint path problem  (Read 7609 times)

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
set breakpoint path problem
« on: March 07, 2007, 10:52:44 am »
Hi,

I'm using a Windows machene with a toolchain that was ment for linux so I have to use cygwin.

The problem is that when I try to set a breakpoint in C::B I get no "such file ..." message. The same happens if I use gdb without C::B but there I can write the path differently and everything is OK.

C::B tries to set the path like this: break "C:/cygwin/home/moon/uart/hello.c:69" and cygwin can't seem to swollow this type of path. The only thing that worked for me (in case I set a breakpoind with the path to it) was: break "/home/moon/uart/hello.c:69" (don't know why break "/cygdrive/c/cygwin/home/moon/uart/hello.c:69" doesn't work).

Has anyone used C::B with cygwin?

Can I change the path that C::B uses to set breakpoints (if not could this be please implemented)?

r. Domen

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: set breakpoint path problem
« Reply #1 on: March 07, 2007, 01:21:29 pm »
If your toolchain works like cygwin, then your user compiler must be a copy of the cygwin compiler, not gcc.
Be patient!
This bug will be fixed soon...

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: set breakpoint path problem
« Reply #2 on: March 07, 2007, 02:53:57 pm »
I'm using a gcc cross-compiler for a different processor so I can't use cygwin gcc (the same sources are used to build a toolchain under linux and there everything works OK). Are wou suggesting that this is a -g flag problem of cross-compiler gcc?

Please explain a bit more.

Domen

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: set breakpoint path problem
« Reply #3 on: March 07, 2007, 03:20:53 pm »
That's not what I 'm saying.

How have you setup the compiler? Edited an existing one? Or created a copy of an existing compiler and edited that one (the copy)?
Either way, what I ' m saying is that you should use the 'cygwin' compiler as a base for your toolchain.
Be patient!
This bug will be fixed soon...

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: set breakpoint path problem
« Reply #4 on: March 07, 2007, 03:53:39 pm »
First of all I stil don't understand what this has to do with gdb as when using gdb without C::B I stil can't set the breakpoints like: break "C:/ ... or break "/cygdrive/ ...

The toolchain is patched so that you can cross-compile for a gnu unsupported processor so patching cygwin toolchain would be almost the same as patching MinGW as we don't have patches for either of them (too old version - patches are ment for the last version).

The only solution that I see is to alwais put projects in cygwin/home/... and have an option in C::B to set the string that should be used before the root project directory part eg. break "/home/test/project/hello.c" where /home/test/ is added in a edit inside C::B (somewhere in the poject settings) and that you enable/disable this (enable/disable use my own path to root project dir) the same way as with makefiles (use my own makefile).

Domen

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: set breakpoint path problem
« Reply #5 on: March 07, 2007, 03:56:10 pm »
Quote
How have you setup the compiler? Edited an existing one? Or created a copy of an existing compiler and edited that one (the copy)?

I think that you ment in C::B right? :oops:

I made a copy of an existing compiler, edited it (copied GNU compiler) and set it as default.

Offline beppe

  • Single posting newcomer
  • *
  • Posts: 2
Re: set breakpoint path problem
« Reply #6 on: March 07, 2007, 05:08:31 pm »
I had the same problem.
I found a solution that for sure is not straightforward and maybe not clean, but at least is working.
1) I recompiled from sources gdb using as directory separator the character ";" instead of ":" (I don't remember which file I had to modify, but it was quite easy to find). If you want to keep the original gdb executable file, you can rename this file as you want and put it in the cygwin/bin directory...
2) From codeblock, menu "Settings/compiler and debugging settings/debugger settings", in the debugger initialization commands I put:
set substitute-path /cygdrive/c/ C:/
set substitute-path /cygdrive/d/ D:/
set substitute-path /cygdrive/e/ E:/
set substitute-path /cygdrive/f/ F:/
set substitute-path /cygdrive/g/ G:/
set substitute-path /cygdrive/h/ H:/
set substitute-path /cygdrive/j/ J:/
set substitute-path /cygdrive/y/ Y:/
set substitute-path /cygdrive/z/ Z:/
Of course, this can be changed based on your disk configuration...

As I told you, I am not an expert, and possibly I found a complicated solution for a simple problem. I leave to the gurus out there to indicate a better solution...
Cheers,

Beppe

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: set breakpoint path problem
« Reply #7 on: March 08, 2007, 11:23:13 am »
Were you also having problems with: break "/cygdrive/c/cygwin/ ... or just with break "C:/cygwin/ ... ?

Alturin

  • Guest
Re: set breakpoint path problem
« Reply #8 on: March 08, 2007, 07:07:00 pm »
Quote
How have you setup the compiler? Edited an existing one? Or created a copy of an existing compiler and edited that one (the copy)?

I think that you ment in C::B right? :oops:

I made a copy of an existing compiler, edited it (copied GNU compiler) and set it as default.

I think you should try copy-ing the "Cygwin GCC" compiler instead of the GNU compiler.

Offline beppe

  • Single posting newcomer
  • *
  • Posts: 2
Re: set breakpoint path problem
« Reply #9 on: March 08, 2007, 10:07:16 pm »
Were you also having problems with: break "/cygdrive/c/cygwin/ ... or just with break "C:/cygwin/ ... ?
Only with "C:/cygwin/ ... ", but this is what C::B passes to gdb...