Kaffe Documentation, can someone help me ?

Stefan Weber sweber at cs.tcd.ie
Thu Sep 28 03:38:41 PDT 2000

On Mon, 25 Sep 2000, federico ardanaz

> Date: Mon, 25 Sep 2000 18:38:42 +0200
> From: federico ardanaz <fardanazp at nexo.es>
> Reply-To: kaffe at rufus.w3.org
> To: kaffe at rufus.w3.org
> Subject: Kaffe Documentation, can someone help me ?
> Resent-Date: Mon, 25 Sep 2000 13:49:10 -0400
> Resent-From: kaffe at rufus.w3.org
> Hello everybody. I am a computer science student at Barcelona/Spain. 
> I was recently making a peek in the kaffe project and sources.  I am 
> finishing my studies in UPC (Politecnical Univeristy of Catalonia) and 
> my goal is to do a little study about hardware implementations of java
> for my final project. The basic idea is try to find out how easy or hard is
> design a microprocessor that can execute both native and java code and
> the performace that a machine of this kind can get.... If you prefer how good
> could be the performance of a system with a standard risc-like processor
> (I am thinking in a UltraSparc, Alpha, ...) with java capability extensions
> that ease and accelerate the implementation of a JRE over this machine.
> The scope of the project is only at desing (computer architecture ) levels so  I
> need a JVM implementation that could be adapted to run the bytecodes over my
> simulated microprocessor rather than translating it (JIT) or making a pure
> software interpretation. I think kaffe is perfect for this! 
> 1) The question is, there is some free documentation that I could use to get
> started with Kaffe source. Kaffe is a more or less big an complex peace of
> software so just reading the code is a hard and slow way to understand it ;-)

Some info that helped me a lot is a page by Ko Ren Song
(http://www.cse.msu.edu/~korenson/kaffe.html) which goes 
through some of the functions of the JVM and explains 
what happens.

Another good way to go through sources is usually 
'ctags' and 'emacs' in combination with 'gdb'. 


(assuming you use bash and have gcc/xemacs/gdb/etc)
1. Build kaffe with debugging enabled
   (I usually build it with static libs so that all symbols
    are known from the beginning when gdb has loaded the 
    executable; with shared libs you have run the application
    before the symbols are known which is kind of inconvenient)
2. Set the environment so that everything is loaded from the
   recompiled version

3. Set KAFFE_DEBUG to your debug environment ie. xemacs, gdb
   and then start an example application

prompt> tar xfz kaffe-1.0.6.tgz
prompt> cd kaffe-1.0.6
prompt> ./configure --prefix=/opt/kaffe-1.0.6 --enable-debug \
 --with-engine=intrp --with-staticlib
prompt> make; make install
prompt> export PATH=/opt/kaffe-1.0.6/bin:$PATH
prompt> export LD_LIBRARY_PATH=/opt/kaffe-1.0.6/lib:\
prompt> ctags -e `find . -name "*.c"`
prompt> export KAFFE_DEBUG="xemacs"
prompt> kaffe HelloWorld

This brings up kaffe in xemacs using gdb and allows you
to hop around between functions using tags e.g. "M-."

> 2) Somebody can explain me how to enable/desable JIT? Both the interpreted and
> "JITed" version are included in the sources but JIT3 are used by default...

I would think that the configuration switch --with-engine=intrp
should do the trick.

just my two-pence, I hope it helps



Stefan Weber                              
E-Mail: Stefan.Weber at cs.tcd.ie            Phone: +353-1-6081543
URL:    http://www.dsg.cs.tcd.ie/~sweber  FAX:   +353-1-6772204

More information about the kaffe mailing list