How to debug Kaffe?
erik.schnetter at student.uni-tuebingen.de
Wed May 14 00:18:03 PDT 1997
I am trying to use kaffe (version 0.84) for some code I compiled using a
different compiler that javac. Of course I ran into some problems, and I
have come to think that kaffe might not be entirely innocent. This leads
me to the question: How do I debug kaffe itself? (I am using kaffe on
I am aware of the options to trace method calls, and to print the address
of every function compiled to native code. I can change my source code to
print some progress and/or debug information. However, the bug seems to
be somewhat persistent, and I'd like some more comfort.
Is there a way to set breakpoints, e. g. using gdb? Is there a
"-breakpoint" option to set a breakpoint in a specific function, or is
there a way to at least to (say) raise a signal at a specific time? (I
could catch that signal in a debugger, or ignore that signal at will.) Is
there any debug information available in kaffe-compiled code? Another
question: is there a way to access the floating point registers from gdb,
or from another debugger on Linux?
The bug I'm encountering (rather: the bug that haunts me) has to do with
single precision floating point arithmetic (double precision works ok) and
occurs only if I execute some other (though apparently totally unrelated)
statements in a certain order before. The bytecode compares a floating
point value to itself with the result being "not equal". This register
should contain the value zero (and not NaN) -- although you never know.
So what I'm really still trying to do is to find out what this bug is
about. In a similar situation some time ago (but not with kaffe) the
reason turned out to be inconsistent usage of the floating point unit
(across several indedepently compiled C files) where the floating point
unit stack got "confused". (A function returning a single-precision value
had no prototype, so the returned float was interpreted as
double-precision value. C is, after all, not typesafe. But that's
another story and shall be told another time.)
Or did someone have similar experiences?
Erik Schnetter, erik.schnetter at student.uni-tuebingen.de
Arthur C. Clarke saw the future.
He knew it would be run by huge computers.
And he was right. Just not about the size.
More information about the kaffe