7

I would like to know if there is any IDE or Eclipse Plugin that supports mixed mode debugging. As I searched the term mixed mode, found lot of references debugging VM languages alongside with native code.

But I referring to a feature that is similar to the one available in compiled languages such as C where an user can see both C source line along side with the corresponding assembly line and will be able to step in even at assembly level. (please excuse If I had made a nomenclature mistake by calling the feature as mixed mode)

In other words I am looking for a following features while debugging java:

  1. Ability to the java source code and the corresponding byte codes during program execution
  2. Ability to see JVM PC registers and Operand stacks
  3. Ability to view other JVM specific data structures (for example constant pools)

This is to understand how the Java source code maps to byte codes and how the various JVM associated data structures are affected while stepping in.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Shree
  • 798
  • 5
  • 13
  • You don't need a debugger to understand how Java source code maps to byte code. Just use `javap`. – Matt Ball Mar 02 '13 at 19:00
  • Good question! With either gdb or MSVS debuggers you can debug at the assembly level as well as at the high-level language level. I'd be curious if there was any way to do something similar from a Java IDE. Here are a few suggestions: [How to debug compiled Java in Eclipse](http://stackoverflow.com/questions/1905446/how-to-debug-compiled-java-code-in-eclipse), and [Is there a debugger/disassembler for Java?](http://stackoverflow.com/questions/2539614/is-there-a-disassembler-debugger-for-java-ala-ollydbg-softice-for-assembler) – paulsm4 Mar 02 '13 at 19:07
  • It's not just a matter of IDEs and plugins. Such a feature would require intimate support from the JVM itself. I suppose an alternative is to use a custom JVM implementation. – Antimony Mar 02 '13 at 19:13

2 Answers2

2

I'm a DSL developer and have sort of run into this same issue a number of times.

The only tool i've found has been the Dr. Garbage tools.

At the current moment, they don't seem to be the best maintained, but they do work with appropriate versions of eclipse.

lscoughlin
  • 2,327
  • 16
  • 23
0

You don't need debugger to understand how Java code maps to compiled native code. You can use -XX:+PrintCompilation JVM flag. See mode info on that in Stephen Colebourne's blog post and more detail in Kris Mok reply to that post.

You may also find HotSpot Internals Wiki useful.

Eugene Kuleshov
  • 31,461
  • 5
  • 66
  • 67