Thread: GCC option to get assembly code AND C code

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    France
    Posts
    1

    GCC option to get assembly code AND C code

    Hello,
    I am working on a C project.
    I would like to see the assembly code generate with GCC.

    The option is "-S". But when I do so, I get a long file with assembly instructions code, really difficult to read.

    What is the option to get both the assembly code AND the corresponding C code, in the same file, to see what C instruction generate assembly code instructions.

    Thx
    Antoine

  2. #2

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    The --fverbose-asm options to gcc is also helpful.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Tags for this Thread