Debugging with Mika
Mika can optionally be built with JDWP support. To enable JDWP support you need to either add the following to your onfiguration/platform/foo file:
JDWP = true ;
(don't forget the spaces!), or include -DJAM.JDWP=true on the command-line. (JDWP support is all in C code, so it's Jam that needs the flag not Ant).
JDWP support is not yet complete, but it already enables many features of Sun's jdb tool and the built-in Java debugging in Eclipse to be used.
Remote debugging
Using jdb
Method 1: on the target device, launch the application in the usual way but with -Xdebug -Xrunjdwp:transport=dt_socket,server=y, suspend=n added to the command line: e.g.
mika -Xdebug -Xrunjdwp:transport=dt_socket,server=y, suspend=n MyApp
Mika will listen for an incoming JDWP connection on port 5555.
Now attach the debugger on the remote machine using
jdb -attach targetaddress:5555}
You can change the port on which Mika listens by adding address=:portnum ro the -Xrunjdwp: parameter.
Method 2: First start the debugger on the remote machine with
jdb -listen 5555
Start Mika on the embedded device with -Xdebug -Xrunjdwp:transport=dt_socket,server=n, suspend=n,address=remoteip:5555
Mika should connect to jdb.
(to be continued ...)
