I compiled my code with "-g" command, and in gdb I can
"L" to list source code
"disass" to list assembly code.
But I wish to display like what I can see in windows visual studio, list one line of source code, list its corresponding disassembly(several lines), then another line of source code, and so on.
I guess gdb should support this, how to specify?
You can mix source and assembly using the /m or /s flags to disassemble. Usually I think the former is what you want. So:
(gdb) disassemble/m main
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With