C++ assembly code in codeblocks IDE on windows


Hi,

I am using code blocks on my windows 10 machine with code blocks GUI. The compiler is GCC. However I am interested to see the assembly code of my C++ codes. Can someone please tell if that is possible?

Thanks in advance :-)
If you're trying to look at assembly in real time while debugging:
https://stackoverflow.com/questions/9619215/how-to-view-the-disassembly-in-codeblocks

If you just want the compiler to output assembly, you have to run the compiler with the -S flag.
https://stackoverflow.com/questions/137038/how-do-you-get-assembler-output-from-c-c-source-in-gcc
g++ -S hello.cpp

If you want it to output assembly to a file at the same time that it compiles, see the answer to this post.
https://stackoverflow.com/questions/48831202/how-to-view-assembly-code-in-codeblocks
Other compiler options
-save-temps


Then, whenever gcc compiles a file foo.c in the project, it will save the intermediate files as:
foo.s   # The assembly
foo.i   # The preprocessed source
Last edited on
Topic archived. No new replies allowed.