gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > mappy source debugging problems

#8874 - foxglove - Tue Jul 22, 2003 4:35 pm

I can't seem to get the MappyVM source debugger to work. I compile my project with the -g option for debugging info, but when I load the .elf in MappyVM, it won't load or run (Gives an error message about an illegal instruction, and then says there is no ROM loaded). Oddly though, after attempting to load the elf, the source debug window shows all the correct source files.

The .bin file loads and runs fine in Mappy and VBA, so it makes me suspicious of my elf, and the way devkitadvance is linking it.

Has anyone else had a similar problem? I would really like to be able to use this feature; I'm getting sick of writing everything to the console...

thanks!
-chad

#8892 - Quirky - Wed Jul 23, 2003 7:34 am

Does the resulting .bin run fine and it's just the .elf that is dodgy? I tend to use visualboy advance and gdb as it's more accurate, but mappy works fine too with my -g compiled .elfs, so I guess you have an "illegal instruction" in there somewhere :-/

#8903 - foxglove - Wed Jul 23, 2003 3:45 pm

Yes, the .bin loads and runs fine... I don't see what could be causing an illegal instruction in the .elf, and not in the .bin. Are you using devkit advance? Maybe there's something screwed up in the way I'm compiling or linking... I don't know.

Also, the same elf seems to work fine in Insight / gdb ( I just don't *like* using insight / gdb).

#8914 - foxglove - Wed Jul 23, 2003 7:56 pm

hmmmmmm.... does anybody have a Makefile that uses devkitadvance, and produces an elf which works in the mappyvm source debugger?

#8933 - Quirky - Thu Jul 24, 2003 8:41 am

Interestingly, I tried a new build in mappy and it crashes (both the bin and the elf file) though it runs fine in VBA. I haven't tried it on hardware yet though. The changes were code in iwram and using thumb code in rom. Mappy doesn't seem to like interworking very much as removing that makes things work to some degree (though in general the game is completely broken in mappy - are certain bios swi calls not supported?).

The relevent bits of my make I think are:

Code:

CFLAGS = -O2 -c -fomit-frame-pointer -mthumb-interwork -Wall -g
LDFLAGS = -nostartfiles -mthumb-interwork -Wl,-Map,game.map -Tlnkscript


Everything else is just a %.c: %.o with the includes.

I'm going to stick with VBA's higher compatibility and gdb I think. And maybe test this on hardware before going much further... just in case.