Using GCC to produce readable assembly?

后端 未结 10 1942
死守一世寂寞
死守一世寂寞 2020-11-22 06:13

I was wondering how to use GCC on my C source file to dump a mnemonic version of the machine code so I could see what my code was being compiled into. You can do this with J

10条回答
  •  旧巷少年郎
    2020-11-22 06:47

    If you give GCC the flag -fverbose-asm, it will

    Put extra commentary information in the generated assembly code to make it more readable.

    [...] The added comments include:

    • information on the compiler version and command-line options,
    • the source code lines associated with the assembly instructions, in the form FILENAME:LINENUMBER:CONTENT OF LINE,
    • hints on which high-level expressions correspond to the various assembly instruction operands.

提交回复
热议问题