I'm a bit new at working with Assembly (and relatively new at programming in lower-level languages), but here's the main question I have:
Question: If I am using Intel-syntax 32-bit Assembly for Linux, how can I compile with nasm and then link so that gdb does not single-step through my processes?
What did I try? There's plenty of people who have partial answers to this question, and there's plenty of answers to this with AT&T syntax. I started with AT&T syntax when I learned assembly [via videos from secutiytube,] and with those files GDB works perfectly when one compiles their code with something like
as -gstabs -o program.o program.s
and then links with the
ld -o program program.o
command. (I'll admit here that I'm not exactly sure what the linking does, and I often see gcc used instead of ld; I'm not sure the difference.) After that, running gdb works fine; one can step through the commands nicely and everything is sunshine. Unfortunately, when I do this with any of my Intel-syntax code now compiling with
nasm -f elf -g test.asm
and linking in the same way the gdb program will run but whenever I break at _start (or anywhere) it will return
Single stepping until exit from function _start, which has no line number information.
which is a bit upsetting, because then I can't run through the processes one at a time and check out what happens in memory.
Any ideas? I'm not married to the idea of using nasm or gdb if similar items have similar functionality.