Author Topic: DEBUG INFO WITH NASM  (Read 18737 times)

nobody

  • Guest
DEBUG INFO WITH NASM
« on: May 01, 2008, 07:12:21 AM »
Hello, I am Grincheux and new to nasm. I need some infos about debugging nasm program. Can someone help me.

When I try to debug my pgm under GDB, it says ther is no debug symbols. Here are my files :

[Grincheux@Grincheux gAE]$ nasm -v
NASM version 2.02-20080413 compiled on Apr 13 2008

;---------------------------------------------------------------------

Copyright © 2001-2004 Free Software Foundation, Inc.
(gdb) file /home/Grincheux/Documents/gAE/gAE
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb)

;---------------------------------------------------------------------

MY MAKEFILE

gAE: gAE.o
   gcc -s -O3  gAE.o -o gAE `gnome-config --cflags gnome gnomeui` `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` `pkg-config --cflags --libs gobject-2.0`
gAE.o: gAE.asm cdecl.inc gtk.inc Profile.asm Datas.asm gAE.inc
   nasm -g -f elf32 -l gAE.lst gAE.asm

Thanks

Grincheux

nobody

  • Guest
Re: DEBUG INFO WITH NASM
« Reply #1 on: May 01, 2008, 07:58:09 AM »
I *think* Nasm is putting debugging symbols in your file, and gcc is taking them out, because of the "-s" switch. Lose that, and you *may* want to tell gcc "-g" also, to get debugging symbols. I think that'll help. I think that version of Nasm is new enough to have "dwarf" format debugging symbols in elf32, too. "nasm -f elf32 -F dwarf -g ...", if you'd care to try it. Good luck, Grincheux, and post if you learn anything!

Best,
Frank

nobody

  • Guest
Re: DEBUG INFO WITH NASM
« Reply #2 on: May 01, 2008, 09:50:26 AM »
Thanks, now I can use a debugger, under linux debuggers are not beter than DE for DOS ! If MS would have made a CodeView for Linux, that would be a great tool, not something like GDB or KGDB...

Thank you for your help. I have just installed NASM because last days I tried FASM but this asm compiler is not able to create debugging symbol ! A DEBUG tool too for Linux. EDLIN, DEBUG, EXE2BIN what beautiful tools... for Linux

nobody

  • Guest
Re: DEBUG INFO WITH NASM
« Reply #3 on: May 03, 2008, 05:14:43 AM »
Not bloody likely M$ is going to release Codeview for Linux any time soon! (it sucked anyway...)

If you really want something more DEBUG-like for Linux, have a look at "ald", Patrick Alken's "Assembly Language Debugger". Here at SF. Or... I don't know where I found this one - somewhere in Taiwan(?)...

http://mysite.verizon.net/fbkotler/debug-0.3.zip

Despite the ".s" extensions, the source code *is* for Nasm(!!!). If you wanted to write a "Codeview-alike" front end, this might be something to start with. Playing with it more is on my ever-shifting "TODO list"... When I start "trace", it squawks about "insmod kcore.o". Attempting that results in a prompt reboot (for me), but ignoring it gives you a vaguely DEBUG-like tool. Interesting! Many thanks to "Zhugejin in Taiwan"!

If existing Linux editors aren't powerful enough for you, you could write an EDLIN clone (it will be for your own use, trust me!). No point to EXE2BIN... so there you are! :)

Best,
Frank