Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tell gdb to disassemble "unknown" code

is it possible to configure gdb in order to debug assembly code when there are no debug symbols or no sources available ? I mean showing assembly instruction by assembly instruction when performing a step by step debug (next /step commands) (not desassembling all the function. just the next instruction that will be executed)

Regards, Ayman

like image 961
Ayman Khamouma Avatar asked Nov 24 '09 15:11

Ayman Khamouma


2 Answers

set disassemble-next-line auto

Is what I find most useful. You can also set it to "on" to disassemble even if source is available.

See the "Source and Machine Code" section in the documentation.

like image 80
ThFabba Avatar answered Oct 21 '22 12:10

ThFabba


Yes. Use display/ni $pc to disassemble the next n instructions.

Also, download the GDB manual.

like image 32
Stephen Canon Avatar answered Oct 21 '22 11:10

Stephen Canon