Using GCC to produce readable assembly?

后端 未结 10 2060
死守一世寂寞
死守一世寂寞 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:55

    I haven't given a shot to gcc, but in case of g++. The command below works for me. -g for debug build and -Wa,-adhln is passed to assembler for listing with source code

    g++ -g -Wa,-adhln src.cpp

提交回复
热议问题