GDB Disassembly Output – No Optimization
Learn how to compile, load, and execute the GDB disassembly program, without code optimization.
Arithmetic example in the C/C++ program
Let’s rewrite our arithmetic program in C/C++. Corresponding assembly language instructions are edited in the comments:
The flowchart below shows the working of the source code:
Disassembly in the no-optimization mode
It is easier to track the progress of our program during debugging if we can recompile without optimization.
Note: You can practice all the commands in the coding playground provided at the end of the lesson.
Compilation
If we compile and link the program in the no-optimization mode (default), as shown below, we get the ...