I was working with JDI api in JPDA. But due to its some limitation I am stuck at some point. What are the alternatives to JDI so that I can write custom debuggers for Java programs ? Preferably Java alternatives.
-
1Why do you need an alternative? What does 'due to some limitation' mean? What makes you think there *is* any alternative? Why would Sun and Oracle do the same piece of work twice? – user207421 Oct 18 '17 at 09:43
-
@EJP Oracle says debugger implementors can write code to interact directly with JDWP layer of JPDA. So its possible to have some alternatives which may provide more functionality. – rainyday Oct 18 '17 at 09:57
-
And @EJP I want to keep watch on modifications and accesses of local variables that JDI does not support. – rainyday Oct 18 '17 at 09:58
1 Answers
JDI is implemented on top of the JVMTI native API. So, if you were willing to go to the effort of implementing your own debug agent code, you could avoid the JDI layer.
However, I doubt that it would get you any further. I suspect that the limitations in JDI are actually limitations in the JVMTI native API itself. (But you can check the JVMTI specification to see if it supports the features you desire.)
Is there an alternative to JVMTI?
AFAIK, no. At least, not for recent Oracle Hotspot releases!
(The JDPA specs acknowledge that not all Java implementations are going to implement the spec, so the possibility exists that other vendors' Java implementations do debugging differently. However, the integration between a core JRE and JVMTI represents a lot of software development effort, so it is unlikely that Oracle (or anyone else) would implement a JVMTI alternative for Hotspot.)

- 698,415
- 94
- 811
- 1,216