i'm very new in assembly (nasm x86_64), and i run into a problem while i tried to use gdb, which says "no debugging symbols found" after assembling with -g -F dwarf options.
I know that the problem can be caused by using .txt instead of .text, but i have corrected it and it didn't really help. I tried to google it, but i haven't found a solution. My .asm and makefile are on the
screenshot.
P.S. sorry my poor english.
-
1Your source and build script should be quoted as text, not shown in a screenshot.ecm– ecm2022-02-11 08:15:08 +00:00Commented Feb 11, 2022 at 8:15
-
1@ecm thanks, i don't think there is a point in editing this question since it is answered already, but i'll take care of it next time.JustLap– JustLap2022-02-11 08:37:56 +00:00Commented Feb 11, 2022 at 8:37
Add a comment
|
1 Answer
Your linking command
ld ‑m elf_x86_64 ‑s $(source).o ‑o $(source)
will remove the generated DWARF debugging information.
‑s is short for ‑‑strip‑all.
Remove this flag for a debuggable executable.
If you wanted to keep just the debugging information, call strip(1) with ‑‑only‑keep‑debug after the linking step.