0

I have experienced completing one program for a couple days, without debugging, and on one of the question I did, ppl suggested me to use debug tools that is possible to debug line by line like VS studio do. I am just getting familiar with using CLI. ( using Ubuntu on VirtualBox. )and looking for someone offering me to Steps to approach using debug tools. Just in case, I use NASM and Gcc tool. and I use them like those below.

 nasm -f elf search.asm    ( this makes search.o )
 gcc -o search search.o asm_io.o  ( I use the external file to use some functions )
 ./search      
3
  • 1
    I put a tiny section in the x86 tag wiki on the commands that are useful for debugging asm with GDB. If you haven't used gdb for other languages, though, then you'll need to learn gdb in general. I absolutely agree with the advice that a debugger is essential for asm. You can't just scatter debug printf calls around like you can in higher level languages, because even calling a function will affect your registers (and it's easy to introduce new bugs, and some functions are optimized in ways that only work for leaf functions...) Commented May 16, 2016 at 1:04
  • That gcc command will only work on a 32bit system. On a 64bit system, you'll need gcc -m32 to link 32bit objects created by nasm -felf. See this post for info on building with NASM and gcc. Commented May 16, 2016 at 1:06
  • It sort of sounds like you are asking for where you can find a tutorial Commented May 16, 2016 at 16:54

1 Answer 1

1

gdb looks to be a solution here :

gdb search

see this link.

Sign up to request clarification or add additional context in comments.

2 Comments

This is pretty much a link only answer. Please elaborate.
I think that elaborating a more precise answer would be including the gdb doc as I don't see any precise restrictions or requirements. So, I wanted to get him where to start. And, au fur et a measure, his advance, SO is always here and I would then elaborate more.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.