NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: HackerWithoutACause on September 19, 2021, 04:16:49 AM

Title: Debugging Multiple Files
Post by: HackerWithoutACause on September 19, 2021, 04:16:49 AM
For the sake of project organization I split my project into multiple files using
Code: [Select]
%include "alloc.s", but now I have the problem that I can not view the lines of assembly with GDB I am using the command
Code: [Select]
nasm -f elf64 -o main.o main.s -g && ld main.o -o main && gdb main to compile the assembly. How can I get NASM and GDB to properly display the lines of assembly that it is running?

I am using NASM version 2.15.05 and GDB version 10.2.
Title: Re: Debugging Multiple Files
Post by: Frank Kotler on September 19, 2021, 04:54:06 AM
I am not much good at gdb.
Adding "-F dwarf" to Nasm's command line might help.
Starting with a single byte instruction - "nop" will do - may help.
Do not give ld "-s".
Good luck!

Best,
Frank