Inspired by emacs plugin disaster, disenchant lets you see asm of the current c/c++ file.
Assembly code is generated by first compiling the current file into an object file. The compilation method is chosen based on the following order of precedence:
compile_commands.json
> Makefile
> direct gcc/g++ invocation
Object file is then passed to objdump after which the asm is shown on split window.
Values inside opts
are defaults. If you don't want to change them, opts can be {}.
{
"evilwaveforms/disenchant",
opts = {
keymap = {
disassemble = "<leader>om",
},
compile_command_c = "gcc -g3 -c %s -o %s",
compile_command_cpp = "g++ -g3 -c %s -o %s",
objdump_command = "objdump -Sl --demangle -Mintel --source-comment --no-show-raw-insn -d %s",
},
},