GP2X Debugging On Gp2x


bbodin

Still Fresh
Joined
Jun 2, 2006
Messages
55
OK, got my first little app going along ok (sdl app, written in C using dev C++). I'm running into an issue however in that it is working fine inwindows, but when I compile and copy onto GP2X, it mostly works but has some bugs in it as well (bugs that I dont' see when I run it in windows).

Anyway, I'd like to trace down what's causing the bugs while running on GP2x, but not sure how. I'm using printf and fprintf to create log files, and that works fine on Windows...but when it runs on gp2x no logs are being created, so I can't figure out where things are going wrong.

I.e I have statements like
printf("Problem opening config: %s\n", configFile);
and
fprintf (stderr, "Couldn't initialize SDL: %s\n", IMG_GetError());

and they output messages in stdout.txt and stderr.txt in my windows directory, but nothing is outputed when its run on GP2x.

Is there an easy way to debug something on my GP2X once it's running there?
 
You can telnet into your GP2x and run software from there.

Once you have TCP/IP over USB running: http://wiki.gp2x.org/wiki/Tcp/ip_over_usb
You can telnet into your GP2x (open start menu, enter "telnet 10.1.0.1" into a run box) login as root, and kill the menu "killall gp2xmenu". Then cd to your directory, "cd /mnt/sd/yoursoftware" and run it "./yoursoftware" you should see printf output on your telnet session then.
 
And if you need more, there is a GP2X version of the GNU debugger which could be usefull in some cases :)
 
Get USB working, telnet into your gp2x, and you can use printf statements just like in windows with no messing around with files - you can even run the gp2x executables directly from your pc's harddisk.
 
Back
Top