3 ms·
You're completely right! Other readers, check it out for yourself with gcc -g sum.c ; echo 'disas main' | gdb ./a.out gcc -g -O2 sum.c ; echo 'disas main' |
by schoen 11y ago
You're completely right!
Other readers, check it out for yourself with
gcc -g sum.c ; echo 'disas main' | gdb ./a.out
gcc -g -O2 sum.c ; echo 'disas main' | gdb ./a.out
- dima55 11y agoPro tip: gcc -S -o- sum.c
- schoen 11y agoOh yeah, that assembly already existed in order to create the binary in the first place! Thanks for the tip. (The gdb disassembly shows memory offsets, which might be helpful for some purposes.)
- kragen 11y agoThe best way to do this, which I didn't know about until recently, is gcc -fverbose-asm -g -Wa,-adhln=sum.lst sum.c