![]() |
|
#1
|
|||
|
|||
Compiler that Shows Stages of Compilation?Is there a C or C++ compiler that explicitly shows the different stages of compilation?
For example, show what the source code looks like after: The line breaks are removed. The comments are removed. The #include directives have been performed. I just think it would be helpful to actually see the different stages the source codes goes through on its way to becoming object and finally executable code. I dobut a "regular" compiler would have this feature, but what about one designed for the educational market? Thanks |
|
#2
|
|||||||
|
|||||||
|
Quote:
If you have GNU compilers (gcc, g++) you can run the preprocessor separately. do this to see what the preprocessor does to source file xxx.c: Quote:
do man cpp to see options, etc. To see assembly language generated from your c program, try Quote:
Thic creates assembly language file xxx.S If you have Visual C++, you can try the following to see the preprocessor output: Quote:
use the following to see other options: Quote:
to see assembly language do this Quote:
This time you get xxx.asm There are command line switches for Borland bcc32; just enter the following (no arguments) Quote:
You will see the options (assuming bcc32.exe is on your %PATH%) Regards, Dave |
|
#3
|
|||
|
|||
|
Thanks Dave!!
It's very interesting to see what the preprocessed source code and Assembly language look like. I tried a little test: I included additional header files, and as expected, the preprocessed code grew in size. However, the Assembly code is only slightly different in size. Very interesting (to me anyway). I've looked at the .asm files and they are mostly the same, but there are slight differences. Thanks! |
Recent GIDBlog
Developing GUIs with wxPython (Part 2) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 32 bit compiler needed | meet_raman | C++ Forum | 2 | 24-Jun-2004 03:42 |
| a noobish compiler question | Charunks | C++ Forum | 5 | 03-Sep-2003 02:18 |
| i need a free Mac compiler | yerdos | C++ Forum | 1 | 28-Jul-2003 02:12 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The