Author Topic: Problem with own makefile and GDB is back again  (Read 4402 times)

Offline kai7

  • Multiple posting newcomer
  • *
  • Posts: 10
Problem with own makefile and GDB is back again
« on: January 31, 2007, 12:10:37 pm »
Hi,

Some months ago I posted this problem with an own makefile and breakpoints:

http://forums.codeblocks.org/index.php?topic=4064

One nice day I downloaded the nightly build CB_20061109_rev3197. There the source files were given relative when C::B sets a breakpoint. So it actually solved my problem. Now I downloaded a new nightly build and the problem is there again. Under the advanced compiler options I found now an option "Use Full Paths for source files (GDB workaround)". But this options doesn't change this behavior. Is there anything I could do or should I stick to the old version?

Thank you,
Kai

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2261
Re: Problem with own makefile and GDB is back again
« Reply #1 on: January 31, 2007, 02:49:12 pm »
Hi,

Some months ago I posted this problem with an own makefile and breakpoints:

http://forums.codeblocks.org/index.php?topic=4064

One nice day I downloaded the nightly build CB_20061109_rev3197. There the source files were given relative when C::B sets a breakpoint. So it actually solved my problem. Now I downloaded a new nightly build and the problem is there again. Under the advanced compiler options I found now an option "Use Full Paths for source files (GDB workaround)". But this options doesn't change this behavior. Is there anything I could do or should I stick to the old version?

Thank you,
Kai


Others have found that removing spaces and special chars from filenames solves these problems.

Offline kai7

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Problem with own makefile and GDB is back again
« Reply #2 on: January 31, 2007, 05:50:37 pm »
Quote
Others have found that removing spaces and special chars from filenames solves these problems.

Thank you for this tip. I tried it (removed the '+' from the path) but it didn't change. I think the problem is that in my makefile only relative paths are used. And it seems that GDB can't convert them to absolute paths.

Jachyra

  • Guest
Re: Problem with own makefile and GDB is back again
« Reply #3 on: February 07, 2007, 02:01:04 pm »
Is there an update regarding this issue because I'm experiencing the same thing.  As soon as I try to use my own Makefile I can longer debug and breakpoints don't get hit.  The actual error message I get is:

Code: [Select]
Debugger name and version: GNU gdb 5.2.1
No source file named C:/source/qt2/main.cpp.

I'm using Qt, so if I don't use the custom makefile, I can debug, but then my resource files don't get included properly.  Kind of a catch-22.

Jachyra

  • Guest
Re: Problem with own makefile and GDB is back again
« Reply #4 on: February 07, 2007, 02:19:19 pm »
Never mind...I can see that this was a gdb issue and not a CB issue.  Upgraded to the most recent version of gdb and now everything works like a charm.

Offline kai7

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Problem with own makefile and GDB is back again
« Reply #5 on: February 07, 2007, 04:34:49 pm »
Good for you. :-)  Unfortunately I am already using the most recent version (6.3.2). One thing I found out is quite interesting: An "info source" gives this:

Code: [Select]
(gdb) info source
Current source file is ../../src/MainWin.cpp
Compilation directory is d:/Daten/C++/FrontDesign/FrontDesign.wx/src/
Located in d:/Daten/C++/FrontDesign/FrontDesign.wx/src/../../src/MainWin.cpp

And so a

Code: [Select]
break d:/Daten/C++/FrontDesign/FrontDesign.wx/src/../../src/MainWin.cpp:xxx
is working as well. So it seems to be a relative-absolute path converting problem within the gdb. So I wouldn't blame CB for this problem. But I am hoping to work around it with CB. ;-)     

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Problem with own makefile and GDB is back again
« Reply #6 on: February 07, 2007, 05:17:44 pm »
Quote
So it seems to be a relative-absolute path converting problem within the gdb. So I wouldn't blame CB for this problem. But I am hoping to work around it with CB.

It's already worked out for you. Just rebuild your project (and any libraries linked to it and you compiled them yourself) and the problem will be gone. This is the reason why absolute filenames are used now when compiling: so gdb can find the files.
Be patient!
This bug will be fixed soon...

Offline kai7

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Problem with own makefile and GDB is back again
« Reply #7 on: February 07, 2007, 06:06:34 pm »
Quote
It's already worked out for you. Just rebuild your project (and any libraries linked to it and you compiled them yourself) and the problem will be gone. This is the reason why absolute filenames are used now when compiling: so gdb can find the files.

Yes, if I would compile it with C::B. But I use my own makefile which is created with an automake script. There the relative paths are still used. Until now I didn't find a way to use absolute paths with such a makefile...

Offline kai7

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Problem with own makefile and GDB is back again
« Reply #8 on: February 08, 2007, 01:10:59 pm »
Why not doing the obvious. :oops: I just ran the configure script using the absolute path of it. No I have a makefile with absolute paths in it and all my problems are solved. Sorry for the "ado about nothing".