[kaffe] Using Kaffe with remote debugging via Eclipse

Dalibor Topic robilad at kaffe.org
Wed Aug 18 10:49:35 PDT 2004


Woloszynski, Charles wrote:
> I am looking to use Kaffe as the target VM for an embedded system.  We
> would like to use Eclipse as the development IDE.  Has anyone worked on
> supporting remote debugging (JPDA) under kaffe?  I saw some old posts
> that this was partly done.  Can anyone comment on its status?

Hi Charles,

unfortunately, there is no JDPA implementation for Kaffe available. I've 
CC:ed Derek L Davies, who did some work on JPDA support in 2000, maybe 
he can comment on the status of his work, and point you to unmerged patches.

An interesting way[6] to provide a general debugger support for free 
platforms, would be to take the gdb MI bindings [2] in eclipse's CDT 
code [1], and use them to write a Kaffe-specific mapping of JDWP 
commands to gdb MI commands to inspect the running code. On top of that. 
you'd need to write an implementation of JDWP, but that shouldn;t be 
that hard, if you can use code from [3],[4],[5] or [8].

The ideas behind using a runtime-specific gdb <-> JDWP mapping are that

a) all other parts of the JPDA can be runtime agnostic
b) gdb is available on and for most platforms
c) gdb allows remote debugging for embedded devices
d) JDWP commands may be able to be translated into gdb MI by looking at 
developers/gdbinit for kaffe, for example
e) native and java code could both be debugged through gdb MI
f) kaffe already can emit debug info for gdb for some jits (xdebugging)
g) in future, when gcj's bc abi stabilizes, and we can use gcj-ed 
libraries, one would be able to debug both kaffe's code and gcj'ed code 
through the same interface: gdb MI.

but it takes a volunteer to prove them in practice. :)

If you take a look at 
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/architecture.html this 
approach would mean that we replace the native JVMDI bit with something 
that talks to gcb directly.

Other free runtimes have some rudementary debugger support:

Electrical Fire : [9], [10]
Wonka : [11]

cheers,
dalibor topic


[1] http://www.eclipse.org/cdt/
[2] 
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-debug/?cvsroot=Tools_Project
[3] http://rubyforge.org/projects/rubyjdwp/
[4] http://www.zenspider.com/dl/rubyconf2003/RubyAndJDWP.pdf
[5] http://www.lichteblau.com/cloak/cl-jdi/README.html
[6] Shamelessly stolen from Tom Tromey[7]
[7] http://www.peakpeak.net/~tromey/free-java.html
[8] http://home.earthlink.net/~jdunrue/josdi/ which seems to have a GPLd 
JDWP implementation
[9] http://lxr.mozilla.org/ef/source/ef/Debugger/
[10] http://www.mozilla.org/projects/ef/techdocs/debugger/debugger.html
[11] http://www.acunia.com/cgi-bin/cvsweb.cgi/open-wonka/jpda/



More information about the kaffe mailing list