-- Leo's gemini proxy

-- Connecting to g.codelearn.me:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

GDB oneliners


Recently I wanted to print disassembled main funciton of the program to the file so I can read it in my Emacs, but it turned out I can't simply redirect the GDB output to the file with `disassemble main > main.asm` command in gdb command line.


But there is `-ex` option exists in gdb command so we can execute some gdb commands right after gdb is initialized.


Looks like this:


gdb <file> -ex 'disassemble main' -ex 'quit' > main.asm

-- Response ended

-- Page fetched on Sat May 11 20:15:38 2024