You are not logged in.

#1 2009-08-03 13:30:34

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 876

GDB doesn't recognize file lines

Hi, I have a problem with GDB. I use Eclipse on Arch i686; I have a project which builds a dynamic lybrary, which is linked by another (main) project. When I try to debug the main project, GDB is unable to place breakpoints in a .h file contained in the shared library project:

No line 60 in file "../Code/../../PamCut/CaloCuts/CaloTrackCut/../../CaloAxis2.h".

But line 60 exists and there is code there:

59 void Reset() {
60    ids.clear();
61    idp.clear();
62    q.clear();

What is happening? It's the first time that GDB plays such a trick on me. Maybe the problem is that the file is a header? I placed breakpoints in header files before, and everything was fine...
Thank you for the help.

Offline

#2 2009-08-07 23:58:22

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: GDB doesn't recognize file lines

Hello Snack!

1. Maybe the problem is that the file is a header? -> You can check it, if you places this content in a c/cpp file.

2. Do you use own Makefile in Eclipse or the builtin ?

Offline

#3 2009-08-08 11:13:08

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 876

Re: GDB doesn't recognize file lines

Hi djszapi, thank you for your reply. Yes, I use a custom made Makefile, built following the Eclipse's standard ones. The strange thing is that I have other  headers with code in my project, and I can place breakpoints there without any issue. Funny enough, in some cpp files instead I get the same errors I get in my troubled header, but even if Eclipse complains about being unable to resolve the breakpoint, the execution flow stops  correctly at the breakpoint.
Things are pretty messed up...

Offline

#4 2009-08-08 14:33:21

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: GDB doesn't recognize file lines

It sounds to me like one of your files (the one that included that header, specifically) was not compiled with the proper debugging flags, and that's what it's having issues with. I'd double check your Makefile to ensure that everything has the -g, or whatever you're using for the debugging flag.

Offline

#5 2009-08-10 18:08:50

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 876

Re: GDB doesn't recognize file lines

I did some checks: everything is compiled with -g3, and GDB has problems with breakpoints only in a specific .h file in my project, so it seems related to that specific header. Does anyone have any idea about how can I try to fix this? Thanks again.

Last edited by snack (2009-08-10 18:10:09)

Offline

Board footer

Powered by FluxBB