GCCSDK build debugging tips


Revision as of 12:42, 25 February 2009 by Caliston (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here may be found a collection of tips regarding debugging complex build processes, such as those used by GCCSDK and the autobuilder. Feel free to add more!

Program X in the build process seems to be hanging

One thing you can do to debug something like this is to use 'strace'. When doing something like 'strace ls' it tells you all the system calls that the program makes (lots and lots of output to stderr). It's quite handy for finding that a program is stalling on a particular call, or similar.

If you can hack around the Makefile to insert something like:

strace -f somecommand someoptions 2> /tmp/strace.log                                                                      

around an existing command "somecommand someoptions" it might give you some more information to track it down further.

I want to know how program X is being called

A user reported their build was hanging with the program 'tic' taking 100% of CPU.

$ which tic

tells you that the program 'tic' with your current $PATH may be found at /usr/bin/tic.

If the machine isn't shared with other users you can replace tic temporarily with something that tells you what arguments it's called with so you can run it by hand:

$ sudo mv /usr/bin/tic /usr/bin/tic-tmp                                                                                   
$ sudo cat > /usr/bin/tic                                                                                                 
echo $* > /tmp/tic.log                                                                                                    
/usr/bin/tic-tmp $*                                                                                                       
$ sudo chmod +x /usr/bin/tic                                                                                              

You'll find the parameters being output in /tmp/tic.log Don't forget to move /usr/bin/tic-tmp back to /usr/bin/tic when you've finished!

Personal tools