NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: decuser on February 03, 2024, 10:25:11 PM
-
nasm newb here...
I have started using nasm and I am trying to debug my program. I did nasm -g and ld -g and when I open gdb, or ddd, it shows my listing and will let me step through the code and whatnot, yay! However, when I try to display a variable's address using 'info address bVar1' it says:
Symbol "bVar1" is at 0x402000 in a file compiled without debugging.
What it means, as I understand it, is that the file was not compiled with gnu debugging symbols. Obviously, there are debugging symbols present, but they're in whatever the default format is for nasm. Should I be worried, or just ignore it?
FWIW, stuff like:
(gdb) x/db &bVar1
seems to work:
0x402000 <bVar1>: 17
Thx!
-
It may help to tell Nasm "-F dwar"
Start your cide wuth a singke byte opcode I like
"nop
st,
BeFrank
-
Ok. I've since learned a lot more about what I'm doing with this stuff (assembly on Linux). I still have the same issue though.
I've tried adding nop as the first executable instruction:
section .data
EOLs: db 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
section .text
global _start
_start:
nop
When I fire up gdb, I'm able to debug fine. I can set breakpoints at my labels, step through code, display memory contents with x/, etc. But, if I try to use:
info address EOLs
I get
Symbol "EOLs" is at 0x402000 in a file compiled without debugging.
Sure enough EOLs is at 0x402000:
(gdb) x/16bx &EOLs
0x402000 <EOLs>: 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
0x402008: 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
(gdb) x/16bx 0x402000
0x402000 <EOLs>: 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
0x402008: 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
Why does it report that it's in a file compiled without debugging?
-
and I've tried it with no -F, -F stabs, and -Fdwarf, same result.
-
""Code" is not a "known section name". Try changing it to .text
Best,
Frank
-
I don't have "Code" anywhere. I have a .text section.
-
My poor exeszight.
Sorry
Frank
-
You and me, both! Screen’s aren’t big enough. Somebody oughtta...