开发者

Debugging assembly

How do I debug assembly code? I'm on Linux and have gdb han开发者_如何学编程dy. I know I can watch registers. What are some methods for debugging assembly code?


You can of course use breakpoints just as with C or any other compiled language, too. This article describes the process of debugging an assembly program a bit.


Using the "disassemble" gdb command you can see the assembly code that is about to be executed. This, in conjunction with watching registers, can give you insight into what the CPU is really doing.


Of course you can use nm command with a parameter of executable elf file, it will shows you the available labels with address. From this you can set a breakpoint on a specific address, then execute a single instruction by using "si" debug command.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜