Java Bytecode Level Debugging? 2
QuantumG asks:
"I'm retargeting GCC (EGCS) to the Java Virtual Machine so that you can compile C to Java bytecode. I've been inserting System.out messages in my bytecode and hacking the output to get it past the verifier but I'm getting kinda annoyed at the fantastic error messages I get from the JVM (most the time it just bombs with an assert error). Does anyone know of a bytecode level debugger for Linux? The only one I've seen is a commercial package for the Mac."
Keep it simple (Score:1)
First, if you need to hand-hack the output, maybe you should fix the original problems in your code generator. Is it possible you've missed something in your hand editting?
Second, keep your examples simple. I've TAed two compiler courses where we generated Java bytecode and seen the verifier die-like-flaming-rubble too many times. People (I'm not saying you) get into the habit of creating examples which are too large and wonder why they don't work - and the VM isn't very helpful. It might not hurt to build some sort of regression test suite that verifies your underlying assumption (i.e. these X language features compile properly).
Last, make sure there is some sort of return operation at the end of every method. This always kills people.
Good luck! PS: how are you mapping the unrestricted flexibility of pointers into the semantics of references? Do you make _everything_ an object in case it gets referred to indirectly?