Getting assembled code
Moderator: Stef
Getting assembled code
Hello,
for debugging purposes, I'd like to be able to locate the addresses of my compiled functions in the ROM (so I could set breakpoints in Gens, for example).
Is there a way to change the "make.exe -f makefile.gen" command to do that ?
for debugging purposes, I'd like to be able to locate the addresses of my compiled functions in the ROM (so I could set breakpoints in Gens, for example).
Is there a way to change the "make.exe -f makefile.gen" command to do that ?
you can use NM for that.
It's what I'm using to generate watchers for KMod,like in this makefile
https://bitbucket.org/SpritesMind/genre ... ile?at=dev
command :
I think you'll need to generate the binary with -g flag, to keep symbols[/code]
It's what I'm using to generate watchers for KMod,like in this makefile
https://bitbucket.org/SpritesMind/genre ... ile?at=dev
command :
Code: Select all
$(NM) -n -S -t x $(ROM).out >$(ROM).nm
Thanks for anwers !
I suppose I must add a flag in :
but which one ? (-g ?)
Sorry, I'm new to makefiles and GCC command line options (and the least that can be said is that the man page is dense ).you can modify the makefile.gen to produce symbol list for instance.
I suppose I must add a flag in :
Code: Select all
release: FLAGS= $(DEFAULT_FLAGS) -O1 -fomit-frame-pointer
Seems interesting. What's the exact name of it (because NM search on Google gives gazillions of results, none of them related to coding ) ?I think you'll need to generate the binary with -g flag, to keep symbols
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
In the makefile.gen fle you can replace this line :
by
and you will always have a symbol.txt file produced along the rom.bin file so you know the address of your variables and functions.
Code: Select all
out/rom.bin: out/rom.out
Code: Select all
out/rom.bin: out/rom.out out/symbol.txt
Nope :
generated a symbol.txt.
There's these lines in makefile.gen :
I suppose they are the one responsibles for that, and I assume they are yours
Code: Select all
make.exe -f makefile.gen debug
There's these lines in makefile.gen :
Code: Select all
debug: FLAGS= $(DEFAULT_FLAGS) -O1 -ggdb -DDEBUG=1
debug: out/rom.bin out/rom.out out/symbol.txt