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
1
vote
1 answer

Eclipse: Unrecognized option: -g

I am trying to start an application in Eclipse with the JVM Option "-g", so that I would be able to view all thread info while debugging using the JDI. However, on start, Eclipse is giving the following: Unrecognized option: -g: Could not create the…
Dean Leitersdorf
  • 1,303
  • 1
  • 11
  • 22
1
vote
1 answer

How can I access the Eclipse Java debugger from a plug-in?

I'm developing a plug-in for the Eclipse platform. This plug-in will be used to give information about the line of Java source code currently being debugged. When debugging a Java program, as you hit a breakpoint, Eclipse switches to the standard…
aemreunal
  • 85
  • 1
  • 1
  • 7
1
vote
1 answer

Where can I find the source code for the com.sun.jdi package?

I wanna to see how to debug the java code using jdi, but i don't know where to get the source code about it. is it in jdk? I have used eclipse to import the src.zip in jdk but that seems doesn't contain the infomation about jdi, where can i find it?
uuball
  • 341
  • 2
  • 5
  • 12
1
vote
1 answer

Invoke static method in Java Debugger Interface (JDI)

In JDI, there is a method Value ObjectReference.invokeMethod(ThreadReference, Method, args list, int options) that invokes a method in the target (debuggee) VM. But how can I call a static method? In such a case, I don't have an object…
daveagp
  • 2,599
  • 2
  • 20
  • 19
1
vote
1 answer

connecting to jvm

I want to get access to jvm heap to iterate over objects. I found following example of how this could be done. I use jdk1.7.0_11. I tried following code: public static void main(String[] args) { RuntimeMXBean runtimeBean =…
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182
1
vote
1 answer

Change class path to launch vm

First of all I am working on linux :) I am trying to launch a VM using JDI. I need to change the arguments in a connector. The connector is a LaunchingConnector connector from Bootstrap.virtualMachineManager(). the code is something like this: …
lesolorzanov
  • 3,536
  • 8
  • 35
  • 53
0
votes
1 answer

A java program to debug another java program using JDI but receive nothing useful event

I have two class. One is debuggee and another one is debugger. I use debugger to debug debuggee. Here's my code: JDIExampleDebuggee package com.linuxea; public class JDIExampleDebuggee { public static void main(String[] args) { String jpda =…
Linuxea
  • 319
  • 1
  • 4
  • 15
0
votes
1 answer

How to programmatically detect whether current JVM is connected by a remote debugger?

The situation that I'm facing is when I debug my code in a sub-thread, whose wrapping future has a timeout, I always get a TimeoutException on the outter future.get(timeout), my idea is if I can know that a debugger is connected, I can dynamically…
D Blacksmith
  • 123
  • 2
  • 6
0
votes
1 answer

How to load a class from a Jar file at runtime with the Java Debug Interface

I am trying to inject a ByteBuddy agent at runtime, in a case where ByteBuddy was not present on the machine (and thus not in the classpath) when the JVM was launched. My first thought was to add the bytebuddy library jar files inside a directory…
AntoineG
  • 93
  • 7
0
votes
2 answers

JDI:How to iterate over HashMap

I get through JDI to get com.sun.jdi.ObjectReference is type java.util.HashMap,then i get filed value "entrySet" ,why it is always null? How can i iterate over HashMap keyValues with java debug api? public static void…
Lson
  • 147
  • 8
0
votes
0 answers

Unable to access JDI classes in Eclipse project

I wanted to try writing my own Debugger but was not able to do so yet as I cannot get Eclipse to allow me to programmatically access any classes of the Java Debug Interface (JDI). At first, I thought I may have a problem with my installed JDK (JDK…
c_steidl
  • 107
  • 2
  • 8
0
votes
1 answer

How can I inspect and prettyprint JDI Value objects using Jackson?

I am trying to prettyprint in JSON format objects I retrieve from the Java Debug Interface. These objects are the arguments of the method where my breakpoint hit. My code inside the BreakpointEvent handler is as follows : // event is the current…
AntoineG
  • 93
  • 7
0
votes
0 answers

How to create new String value in Java JDI?

I'd like to invoke a method in JDI which has String as a parameter. So first I will have to create a String value(com.sun.jdi.Value) but the only way which comes to my mind is to use the newInstance() method on ClassType, but this method also takes…
Nfff3
  • 321
  • 8
  • 24
0
votes
0 answers

How to disable all EventRequsts inside JDI?

To disable all EventReqeusts inside JDI, currently I am using: private void disableRequest(EventRequest request, List < EventRequest > disabled) { request.disable(); disabled.add(request); } ... List requests = new…
Nfff3
  • 321
  • 8
  • 24
0
votes
0 answers

How to check if ClassType inherits from java.util.Collection in JDI?

I can get all the interfaces of a ClassType with allInterfaces() but this results in many JDWP calls to the debuggee which is slow. Another approach would be to check this: Collection.class.isAssignableFrom(classType) but the method…
Nfff3
  • 321
  • 8
  • 24