How can I permanently change the disassembly flavor in GDB. I tried:set disassembly-flavor intel
in GDB, but when I fire up GDB later it still has the att flavor.
Permanently Change Disassembly Flavor in GDB
gdb executes a ~/.gdbinit
file when it starts, if present. You can add this line to it:
set disassembly-flavor intel
From the shell, this command will append that line, creating the file if it doesn't exist:
echo "set disassembly-flavor intel" >> ~/.gdbinit
The GDB manual's page on machine code and disassembly documents the command, and that the default is set disassembly-flavor att
.
For more tips on asm debugging in GDB, like layout reg
+layout next
, or layout asm
TUI mode, see the debugging section at the bottom of the x86 tag wiki.
The chosen disassembly-flavor
is used for the disassembly pane in asm
and asm+reg layouts, as well as for disas
and x /i
commands.
I did not have a ~/.gdbinit file, but I created one and added set disassembly-flavor intel to it. Worked Thanks! –
Rustler
My config file was located at
~/.config/gdb/gdbinit
. Try that file if this didn't work! –
Intercessor © 2022 - 2024 — McMap. All rights reserved.