开发者

DEBUG For Linux

I'm now extending more my x86 Assembly knowledge and one of the best tools for learning is DEBUG. When I was learning Assembly(past 4 years) I was on Windows, but now I'm on Linux Ubuntu and the DEBUG tool is only for Windows. Then I want to know is there is any port or equiva开发者_JAVA百科lent for Linux.

Remember that I don't want to debug my code, but do things like the command -r, -t, -e...


-r = info registers
-t = stepi
-e = no direct equivalent; taviso wrote a macro providing similar functionality

debug with no args starts up with some blank 64k of memory that you can play around with; GDB doesn't. That really only made sense on DOS anyhow; you'll have to start with some binary.

Maybe assemble some blank slate like so?

$ echo .globl main >a.s
$ echo main: >>a.s
$ for i in {1..65536}; do echo 'int $3'; done >>a.s
$ cc a.s
$ gdb a.out
(gdb) run


gdb is pretty much the debugger on the Linux platform. You don't specify what features you require, but it probably has them :)


I used DEBUG mostly to assemble rather than "debugging"... if that's your goal,

  • NASM is a good assembler with more similar syntax

  • Use gdb to then run the code, allow disassembly, and examine memory


gdb - the GNU project debugger is the Linux standard debugger. It is far more powerful than DEBUG (if by that you mean the old DOS tool) and you should really learn at least the basics of how to use it if you are programming on Linux.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜