NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: Rodrigo Robles on October 12, 2021, 09:50:03 PM

Title: GDB/DDD fails to step debugging even with debug info
Post by: Rodrigo Robles on October 12, 2021, 09:50:03 PM
After upgrading my Debian Box, my nasm upgraded to version 2.15.05 and gdb to 10.1.90.

So ddd start failing to step debugging, it says "single stepping until exit from function <NAME>, which has no line number information". But DDD is showing the source with the line numbers. Fails both for stabs and dwarf formats.

I have another box with Ubuntu Focal, NASM 2.14.02 and gdb 9.2 where gdb/ddd works well, but only with dwarf format.

Any ideias how to solve this?
Title: Re: GDB/DDD fails to step debugging even with debug info
Post by: Frank Kotler on October 12, 2021, 10:56:10 PM
Welcome to the Forum.

I don't know.

As you seem to know, Nasm defaults to "stabs" but "dwarf" is preferred. So "-F dwarf".
Do NOT give ld "-s". Seems obvious but some people  do it.
Give gcc "-g" if you're using it.
Start your code with a single-byte opcode,,, "nop" is good.

Other than that... Good Luck!

Best,
Frank