Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Java Programming

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."
This discussion has been archived. No new comments can be posted.

Java Bytecode Level Debugging?

Comments Filter:
  • I'm not sure how far your project has progressed so my suggestions may not be helpful.

    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?

The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny ..." -- Isaac Asimov

Working...