R
R
RokkerRuslan2014-05-04 19:55:49
linux
RokkerRuslan, 2014-05-04 19:55:49

How to debug assembler with gdb?

gcc will disassemble the file. Is it possible, in some way, to get a binary file with debug information and debug it? It is to set breakpoints on specific assembler commands, to view the values ​​of registers. In general, just like debugging C code with gdb.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2014-05-04
@RokkerRuslan

gcc disassemble the file

gcc does not disassemble files. Disassembles objdump.
If it's possible to recompile the source, add -g to the compilation and link steps. Otherwise, no.
b *address
View the commands themselves at the current address -- x/10i $pc
info registers, p $register name

L
Lolshto, 2014-05-04
@Lol4t0

Yes, about the same as usual. No debug information is needed. break can be placed on labels. Print registers and variables.
management

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question