Questions tagged [jdi]

The Java Debug Interface (JDI) is a high level Java API providing information useful for debuggers and similar systems needing access to the running state of a (usually remote) virtual machine.

The Java Debug Interface (JDI) is a high level Java API providing information useful for debuggers and similar systems needing access to the running state of a (usually remote) virtual machine. It provides information useful for debuggers and similar systems needing access to the running state of a (usually remote) virtual machine.

The JDI provides introspective access to a running virtual machine's state, Class, Array, Interface, and primitive types, and instances of those types.

The JDI also provides explicit control over a virtual machine's execution. The ability to suspend and resume threads, and to set breakpoints, watchpoints, ... Notification of exceptions, class loading, thread creation... The ability to inspect a suspended thread's state, local variables, stack backtrace...

JDI is the highest-layer of the Java Platform Debugger Architecture (JPDA). For more information on the Java Platform Debugger Architecture, see the Java Platform Debugger Architecture documentation for this release and the Java Platform Debugger Architecture website.

107 questions
3
votes
0 answers

java.lang.ClassNotFoundException in Eclipse using JDI Debug Model version3.17.0.v20201117-1145

I was using Eclipse 2020-12 with OpenJDK 14 under Windows 10 without problem until some days ago, now I can't open or use any function which use JDI due to a ClassNotFoundException (ie: setup run configurations, launch a server, open debug…
moretti.fabio
  • 1,128
  • 13
  • 32
3
votes
0 answers

Resolving a JDWP Error 502

I am working on a JDI project and connecting it to a tomcat server. If I have a bug in my code that causes my project to fail, while attached to the tomcat server, I will start to get com.sun.jdi.InternalException: Unexpected JDWP Error: 502 when…
Silas
  • 201
  • 4
  • 16
3
votes
1 answer

Java Debugging Interface (com.sun.jdi) package missing in IntelliJ 2017.1-C

I'm currently using IntelliJ IDEA Community Edition 2017.1 to work on a project that involves using a Greenfoot port (GitHub) that's optimized to use Groovy. The code is perfectly fine, but IntelliJ is telling me that com.sun.jdi doesn't exist. I am…
user7514069
3
votes
1 answer

JDI, Java Byte code instrumentation and Java agents (JWDP, JVMTI)

I am new in the realm of debuggers, instrumentation and JVMTI. So I have few questions about them. What is the difference between JDI(java debugger interface), JWDP, javaagent and native agent(JVMTI). and where does the java instrumentation API fit…
Rahul khandelwal
  • 331
  • 3
  • 14
3
votes
3 answers

Can Ant launch two java applications concurrently?

I am currently developing a "debugger" java application that uses JDI to connect to an already running "target" java application. Is there any way to have Ant launch my target application then launch my "debugger" afterwards, while the first…
Sandro
  • 2,219
  • 4
  • 27
  • 41
2
votes
1 answer

Java Debug Interface: put the breakpoints at arbitrary locations in the code

I am using the Java Debug Interface API to write the custom programs for debugging the Java applications I write. I am able to add breakpoints to the start of a required method invocation by using the code as: ReferenceType classRef =…
Xolve
  • 22,298
  • 21
  • 77
  • 125
2
votes
1 answer

Java plugin development with debug interface problem

Hello i'm trying to develop an eclipse plugin (in eclipse) that uses the Java debugging interface and i'm getting the following error: Access restriction: The type VirtualMachine is not accessible due to restriction on required library…
Paul Johnson
2
votes
1 answer

How is Java's JDI cross platform if JVMTI is not?

So Java's debug interface is using JVMTI as a backend....but JVMTI needs to be compiled on the target architecture, so are these JVMTI functions which are used by JDI pre-compiled and shipped with the JDK as libraries? This would mean that I can use…
Nfff3
  • 321
  • 8
  • 24
2
votes
1 answer

Is it possible to start java jdwp after JVM startup (aka: at runtime) without command line parameters?

I would like to enable debugging at some point on the current JVM without adding the command line parameters -agentlib:jdwp. Is it possible to do so programmatically from within the current running JVM ? Without any third party libraries ? Other…
Simon
  • 2,353
  • 1
  • 13
  • 28
2
votes
1 answer

Is it possible to get JDI's current StackFrame in Java at the debuggee side?

So, JDI allows us to set a breakpoint in the debuggee app and then get the current StackFrame via JDWP. To my understanding, JVMTI is used at the debuggee side to send the requested information to JDI through JDWP. Is it possible to get the current…
Nfff3
  • 321
  • 8
  • 24
2
votes
0 answers

com.sun.jdi.InternalException: Got error code in reply:502 occurred invoking method

I am trying to debug a remote service and keep getting this error in eclipse debugger.I initially thought that it is a network issue and setup the debugging environment on a remote VM but the issue still persists. Please, help me in resolving it.
DS2020
  • 21
  • 1
2
votes
0 answers

JDI Location of all exit point of a given method

I'm working with JDI api (Java Debug Interface) and I try to create breakpoint requests for the first line of code of a particular method, but also on all "exit points" of the method (i.e. on all "return ...;"). To create a breakpoint request, I…
ben75
  • 29,217
  • 10
  • 88
  • 134
2
votes
1 answer

Eclipse: Inline breakpoints

Is there a way to set inline breakpoints (with a plugin) in the Eclipse IDE? For example when multiple methods are called in the same line, is there a way to set a breakpoint for a specific method call in that line and not for the complete…
Marcono1234
  • 5,856
  • 1
  • 25
  • 43
2
votes
0 answers

JDI watchpoints on Local Variables

I need to set watchpoints on Local Variables, but the problem is JDI allows ModificationWatchpoint and AccessWatchpoint to be set only on class/instance variables. Only approach I could think of is monitor stackframes after execution of each line,…
rainyday
  • 353
  • 3
  • 17
2
votes
2 answers

build a simple debugger with jdi to set breakpoints and retrieve the value of a variable

I am looking to build a debugger using java debug interface. My objective is to set a breakpoint and get the value of a variable. I found this answer close to what i am looking for, I understand that i have to use the following interfaces :-…
Satnam Sandhu
  • 610
  • 1
  • 10
  • 25