NASM Forum > Programming with NASM

I need a debugger for NASM programs

(1/1)

kanito73:
Hello everybody

Finally I'm writing some assembly programs on Linux, but need a good debugger that supports assembly. Kdbg and DDD run the programs but Kdbg does not trace the code on the source window (just can see how change the registers and the IP register, I have to imagine or trace mentally the code), and DDD does not even show the code and the same thing that only advances IP and show register changes but the code windows is completely blank. They only work fine for C/C++ programs.

The only debugger that is able to load and trace assembly programs is GDB. It traces fine the execution but does not show the system stack, it only shows a function stack to trace the functions execution path and need to see the system stack since I'm working with it (PUSH/POP/ENTER/LEAVE to see and test how parameters are passed to functions, how to create and use stack frames, etc.)

Anybody knows about GOOD a Linux debugger supporting the system stack or how to show the system stack instead of the function execution stack? For my purposes, I do not require the functions-trace stack... I'm creating low level standalone functions...

Thanks for your help

Frank Kotler:
You almost certainly want GDB. It requires some learning! Unfortunately I used another debugger and never learned GDB. Assemble with "-F dwarf". Do not give ld the "-s" switch! Start your code with a "nop". A good  "gdbinit" file will help make GDB friendlier to asm. I do not currently have one.

This might(?) help:

https://www.cs.umb.edu/~cheungr/cs341/Using_gdb_for_Assembly.pdf

Good Luck!

Best,
Frank


kanito73:

--- Quote from: Frank Kotler on February 20, 2019, 01:40:23 AM ---You almost certainly want GDB. It requires some learning! Unfortunately I used another debugger and never learned GDB. Assemble with "-F dwarf". Do not give ld the "-s" switch! Start your code with a "nop". A good  "gdbinit" file will help make GDB friendlier to asm. I do not currently have one.

This might(?) help:

https://www.cs.umb.edu/~cheungr/cs341/Using_gdb_for_Assembly.pdf

Good Luck!

Best,
Frank

--- End quote ---

Thanks for your response!

The problem is already solved at this moment, just used -Fdwarf (instead of -Fstabs) and the assembly appeared and worked on Kdbg, for the stack I opened a "memory window" at SP +/- some qwords backward/forward and was able to show the stack and debug to see how it works. By the way, I'm still interested on using and learning GDB, I will study the PDF and the documentation to try to do the same in plain GDB.

Again, thanks a lot!

Navigation

[0] Message Index

Go to full version