Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > see compiler generated code

Reply
Thread Tools

see compiler generated code

 
 
mkorobko@yahoo.com
Guest
Posts: n/a
 
      04-22-2009
I was wondering if there is a way to see the source code generated by
compiler - anything that compiler inserts such as constructors,
destructors, vptr, etc . Looking at this can help to learn.
 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      04-22-2009
> I was wondering if there is a way to see the source code generated by
> compiler - anything that compiler inserts such as constructors,
> destructors, vptr, etc . Looking at this can help to learn.


This is one of those questions where you will also get good answers from the
forum covering your own compiler.

I would...

- debug the code and step into each method
- debug with the disassembly turned on, so you can see the opcodes
- use cfront, IIRC, to turn the C++ into C, with all the C++ features
hanging out
- debug that!


 
Reply With Quote
 
 
 
 
mkorobko@yahoo.com
Guest
Posts: n/a
 
      04-22-2009
On Apr 22, 12:51*pm, "Phlip" <phlip2...@gmail.com> wrote:
> > I was wondering if there is a way to see the source code generated by
> > compiler - anything that compiler inserts such as constructors,
> > destructors, vptr, etc . Looking at this can help to learn.

>
> This is one of those questions where you will also get good answers from the
> forum covering your own compiler.
>
> I would...
>
> *- debug the code and step into each method
> *- debug with the disassembly turned on, so you can see the opcodes
> *- use cfront, IIRC, to turn the C++ into C, with all the C++ features
> hanging out
> *- debug that!


Thank you.
 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      04-22-2009
>>>> - use cfront, IIRC

>>> Where exactly would one obtain a copy of cfront?

>>
>> Google is your friend!

>
> It was a rhetorical question.


http://www.google.com/search?q=IIRC


 
Reply With Quote
 
Bart van Ingen Schenau
Guest
Posts: n/a
 
      04-23-2009
On Apr 22, 6:41*pm, mkoro...@yahoo.com wrote:
> I was wondering if there is a way to see the source code generated by
> compiler - anything that compiler inserts such as constructors,
> destructors, vptr, etc . Looking at this can help to learn.


No, you can't obtain any source code for the compiler-generated parts
of the program, because the compiler does not create source code for
that.
The best you can get is to ask the compiler to output (annotated)
assembly code, but be aware that optimisations can make it very hard
to recognise your own code in the produced assembly.

Bart v Ingen Schenau
 
Reply With Quote
 
mkorobko@yahoo.com
Guest
Posts: n/a
 
      04-23-2009
On Apr 23, 3:23*am, Bart van Ingen Schenau
<Bart.van.Ingen.Sche...@ict.nl> wrote:
> On Apr 22, 6:41*pm, mkoro...@yahoo.com wrote:
>
> > I was wondering if there is a way to see the source code generated by
> > compiler - anything that compiler inserts such as constructors,
> > destructors, vptr, etc . Looking at this can help to learn.

>
> No, you can't obtain any source code for the compiler-generated parts
> of the program, because the compiler does not create source code for
> that.
> The best you can get is to ask the compiler to output (annotated)
> assembly code, but be aware that optimisations can make it very hard
> to recognise your own code in the produced assembly.
>
> Bart v Ingen Schenau


Thanks everyone for your replies. It was helpful.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can the cooglebot "see" javascript generated pages Michel Firholz Javascript 3 08-18-2006 03:27 PM
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
How do I view code generated by a Just-In-Time Compiler? David Wake Java 5 02-11-2005 10:38 AM
Compiler code optimization: see code below joshc C Programming 14 01-14-2005 01:02 AM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57