Debug build

John Freeman jfreeman@cs.tamu.edu
Wed Jul 2 19:42:00 GMT 2008


Ian Lance Taylor wrote:
> John Freeman <jfreeman@cs.tamu.edu> writes:
>
>   
>> This is something I look into periodically, and each time I find a
>> solution that's slightly better, but not what I want.  I've looked at
>> the wiki (http://gcc.gnu.org/wiki/DebuggingGCC) many times, so no need
>> to refer me there.  I am trying to debug the C++ front-end, and I took
>> the wiki's recommendation for building a debuggable compiler
>> $ make CFLAGS="-g3 -O0" all-stage1
>> but it did not seem to build the C++ front-end, even though I
>> configured with --enable-languages=c,c++.  There is no
>> $build-dir/gcc/cc1plus and $build-dir/gcc/cp is empty.  Also, the
>> command
>> $ make install
>> failed afterward with
>> /bin/sh: line 1: cd: ./fixincludes: No such file or directory
>>
>> Any help?
>>     
>
> Use --enable-stage1-languages=c,c++ .
>   
I did this and it did build the C++ front-end at stage 1.  However, it 
still failed to install.

> You need to configure with --disable-bootstrap if you want the C++
> frontend built in "stage1".  Also try make all-gcc instead (or just make
> to also build the runtime).
>
> Richard.

I think this method is different in ways that will increase the build 
time.  Can anyone confirm?

I feel that with either of these suggestions, the documentation on the 
wiki needs to be changed.  It says

"To build a debuggable compiler, configure the compiler normally and 
then ..."

Also, it says to add
CFLAGS="-g3 -O0"
to the make command.  I've done this, and although I haven't tried 
debugging the compiler, I've watched the make output, and it never 
compiles anything with these CFLAGS.  Is it pointless to include it in 
the make command?  I feel like the DebuggingGCC wiki is useless except 
for the scripts (debug, debugx) that it links.

Opening up this topic a little more, is there anyone out there who 
routinely works on GCC that would like to share their workflow for 
building (as little as possible that encompasses changes), testing, and 
debugging?

- John



More information about the Gcc mailing list