Author Topic: Debugging Multiple Files  (Read 11046 times)

Offline HackerWithoutACause

  • New Member
  • Posts: 1
Debugging Multiple Files
« 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.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Debugging Multiple Files
« Reply #1 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