Nathan Campos
Nathan Campos

Reputation: 29497

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 equivalent for Linux.

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

Upvotes: 2

Views: 3290

Answers (4)

ephemient
ephemient

Reputation: 204668

-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

Upvotes: 4

Joe Koberg
Joe Koberg

Reputation: 26699

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

Upvotes: 4

Thomas
Thomas

Reputation: 181705

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

Upvotes: 4

anon
anon

Reputation:

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.

Upvotes: 0

Related Questions