This is the GDB version for Windows that allows remote debugging on the GP2x from within windows.

Copy the arm-gdb file anywhere in your PATH
Copy the gdbserver file onto your GP2x

You must have enabled Networking on the GP2x and have set up a connection between windows and your GP2x
following this tutorial:


To start debugging you must have a copy of the executables to debug on both the Gp2x and the PC,
and a copy of all lib's you're going to step into on your PC (don't bother copying them,
they don't contain any debug info and are unusable except to step into ARM disassembly)


To start a debugging session, first copy the executable on the GP2x.
then open a connection to the GP2x by telnet :
(replace 192.168.1.2 by your real Gp2x IP adress)

> telnet 192.168.1.2 -l root
> [root@gp2x root]$ cd /anywhere/to/your/exe
> [root@gp2x exe]$ gdbserver foo:1234 myexe.gpe

foo:port indicate that you're gonna use debugging over TCP on port 1234, the word before :
is mandatory to indicate a TCP connection but is not used at the moment so wite whatever pops into your mind.

your GP2x is now waiting for a GDB client to connect from a distant computer (namely windows)

on Windows, launch arm-gdb /path/to/the/exe/on/windows/myexe.gpe
the files on the Gp2x and the computer don't have to be exactly the same, the one on the GP2x can have its
debug info stripped as long as the one on your computer is exactly the smae version and has all the debug info.
Strip the exe before copying it on the GP2x to save space if you want, but don't compile an optimized version
before copy - it would change code arrangement in the file, and gdb wouldn't be able to debug it.

then in GDB connect to the distant gdbserver with the command
target remote @gp2x's adress@:PORT

for example
target remote 192.168.1.2:1234

type "cont" to start debugging (on a standard local gdb debugger launching the program can be made via
the "run" command; however it's gdbserver's work to run it and when gdb connects the program to debug
has already been started and is paused on the entry point, that's why you should not use "run" but "cont" instead)


GDB with Eclipse:
Supposing you've been able to setup a development environment with Eclipse and the CDT and you're able to build executable
for the GP2x, you can setup Eclipse to use the arm-gdb server to debug the GP2x, here are the steps :
- you still have to copy the executable on the GP2x (it can be done via the Makefile though)
- you still have to manually run gdbserver on the GP2x (i wish it could be done automatically, i'm currently checking how it
would be possible without the makefile: this step has to be done for EACH DEBUGGING SESSION and not only when you've built
the executable)
- then in Eclipse create a new debugging target, the application is the exe you've built
- under the Debugger configuration item, choose gdbserver Debugger, enter "arm-gdb" as the debugger's name
- GDB command set should be set to Standard(Windows)
- protocol is mi2
- under connection, choose a TCP connection and enter the GP2x' IP adress and the port you've launched gdbserver with
- under SHared Libraries you can enter a path that contains a copy of the "/lib/" folder of the Gp2x for the local GDB to use.
it won't hurt if you don't copy them as there is no debug info in it.

Now press the debug button to start the local GDB :)


Happy eclipsin' with your GP2x now :)


BUGS:
Eclipse doesn't seem able to find the source files for some reason, i don't know if it's a build problem or a problem with GDB
or even with Eclipse maybe.