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      
jay
  • 55
  • 1
  • 8
  • 1
    I put a tiny section in the [x86 tag wiki](http://stackoverflow.com/tags/x86/info) 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...) – Peter Cordes May 16 '16 at 01: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](http://stackoverflow.com/questions/36861903/assembling-32-bit-binaries-on-a-64-bit-system-gnu-toolchain/36901649#36901649) for info on building with NASM and gcc. – Peter Cordes May 16 '16 at 01:06
  • It sort of sounds like you are asking for where you can find a tutorial – David Hoelzer May 16 '16 at 16:54

1 Answers1

1

gdb looks to be a solution here :

gdb search

see this link.

Vtik
  • 3,073
  • 2
  • 23
  • 38
  • This is pretty much a link only answer. Please elaborate. – David Hoelzer May 16 '16 at 16:52
  • 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. – Vtik May 16 '16 at 18:00