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 > Debugging with the mappy 0.9
#16610 - yaustar - Fri Feb 20, 2004 9:59 pm
I can get source to appear with no problems, the problem arises with mappy running at 0.01 fps (or similar) and breakpoints do not seem to work.
Any help is welcome.
(ps I am not having much luck with vba and insight either.. :( ) _________________ [Blog] [Portfolio]
#16615 - dagamer34 - Sat Feb 21, 2004 1:30 am
I couldn't get it to work either. I can see the source code but that's all.
That's worst thing about not having an official SDK: the lack of an easy-to-use debugger. _________________ Little kids and Playstation 2's don't mix. :(
#17430 - josath - Mon Mar 08, 2004 12:31 am
i use VisualBoyAdvance & GDB, works pretty well for me, all I do is:
VisualBoyAdvance -G tcp <game>.elf
then run gdb:
gdb <game>.elf
then in gdb type:
target remote localhost:55555
and then type 'continue' to start the game running. Note, you have to use the SDL version of VisualBoyAdvance, and gdb must be compiled for ARM (put --target=arm-elf when you compile it if you compile it yourself, but there are places to download it already compiled)
Also, make sure you are running the .elf - NOT THE .BIN OR .GBA file. the .bin and .gba files have all debugging information removed.
quick list of gdb commands:
continue - continue program running
step - step through program line by line
break function - set a breakpoint when function() is called
bt - back trace, show currect location of program execution
bt full - back trace, with showing all local variables
print <expression> - evaluate expression, can do stuff like
print myVar - shows contents of myVar
print myFunc() - shows return value of myFunc
In VBA, hit F11 to pause execution and be able to do stuff in GDB
Also, if you use VBA, you can use this command to print out debugging messages in your program:
Code:
// ARM code -- print debug message
void
print(char *s)
{
asm volatile ("mov r0, %0;" "swi 0xff0000;": // warning! will crash on hardware!
:"r" (s):"r0");
}
then just call print("This is my message\n"); to get your message printed to the VBA output window.
Hope this helps!
[/code]
#17431 - yaustar - Mon Mar 08, 2004 1:54 am
Well, I give insight another shot...I let you know of the results. :) _________________ [Blog] [Portfolio]