How to debug programs from the google code repository

Is there a way to debug C++ projects from the google code repository. I tried all the well known ide's like eclipse, netbeans, codeblock, kdevelop..but somehow they don't seem to work. I also tried to create a makefile in order to import the project into the ide using:
all:
g++ code_dir/*/*.?pp -o fake

But somehow nothing seems to work. I am stuck at it for more than 100 hours...does anyone know how to debug the project

with the help of an ide.

Somehow kdevelop works better than the others..but the debug option does not work for the project and it is not able to find the header files which are within the project...can someone please help.
Last edited on
Does it have to be an IDE?

I downloaded the zip file, extracted the contents, and build everything using the following command:

make

All the executable files were built quite happily without problems.

I then went into the bin directory and ran one of the created executables under the GNU Debugger as follows:

gdb ./rdf3xload

I then set a breakpoint at the function main as follows:

break main

and then I let it run

run

The debugger interrupted the program at the breakpoint, presenting me with some information about the breakpoint:

Breakpoint 1, main (argc=1, argv=0xbf8cc954) at rdf3xload.cpp:673


I examined the variables at hand:

print argc
$1 = 1


which confirmed that there was no problem debugging it.


Last edited on
You could add the -ggdb flag to have more debugging information.
The headers are in the include directory. (so you need to configure your IDE to search there)
@Moschops First and foremost thanks a ton for replying. when i am building using 'make' I am getting the following error:

In member function ‘void BTree<T>::packLeaves(S&, std::vector<std::pair<V, unsigned int>, std::allocator<std::pair<V, unsigned int> > >&) [with S = AggregatedFactsSegment::IndexImplementation::LeafEntrySource, V = AggregatedFactsSegment::IndexImplementation::InnerKey, T = AggregatedFactsSegment::IndexImplementation]’:
cc1plus: internal compiler error: Segmentation fault

Is there a way to get around this error. Thanks a ton for helping again. Really appreciate your effort.
I get similar warnings, but they're just warnings about an unused variable which isn't a problem. Looks like your compiler, however, has a fault. I built using GCC V4.0.2 ( g++ --version)

If your compiler is just getting lost in the warnings, removing -Wall and -Wextra from the makefiles will stop it warning on these unused variables.
Last edited on
@Moschops Thanks a ton again for replying. When i am using the following flags I am not getting any error:

make CFLAGS="-g -O0" CXXFLAGS="-g -O0" STAGE2_CFLAGS="-g -O0"
STAGE3_CFLAGS="-g -O0"

But i am not getting the reason as to why by setting these flags i am not getting any error.

Is it logically correct to use these flags?


Also sorry for disturbing again. And thanks a lot again. Also please excuse my ignorance.
Also mu editors version is:
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5.1) 4.4.5
Last edited on
Looks reasonable to me. Those flags include debug information and turn off optimisation. If it builds the executables, no worries.
Topic archived. No new replies allowed.