[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: debugging cc


Ð ë ê þ ã K wrote (deepak2000@xxxxxxxxxxxx):

> >do a cc -g myprog.c
> >
> i want to see how cc actually compiles this program , not how myprog.c 's
> executable runs

Try gcc -v to see a list of all programs being invoked during the compilation
process. You can also play with other gcc flags to stop compilation at these
intermediate steps to inspect their output.

What happens in each stage of compilation is probably too long to be explained
in a news group. Read "Compilers: Principles, Techniques and Tools" by Aho,
Sethi and Ullman, (affectionately called the Dragon book) Addison Wesley, if
youre interested in parsing/code-generation/optimisation/etc. I should warn
you that this is not for the faint hearted!

Happy reading!

- Raja