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
33
votes
3 answers

Why does the debugged program slow down so much when using method entry debugging?

I'm using jdi interfaces to create a debugger and when I use MethodEntryRequests to enable method entry tracing the debugged program slows down by factor of tens. I have set filter for main thread and suspend policy to SUSPEND_EVENT_THREAD.…
JtR
  • 20,568
  • 17
  • 46
  • 60
22
votes
6 answers

JDI Thread Evaluations has encountered a problem

I'm running Eclipse for Java. I created a DOM version of an XML file. Now I want to change an attribute of an element in the file. I called a method that called a method in the class that controls the DOM, and I got a dialog box saying "JDI Thread…
chama
  • 5,973
  • 14
  • 61
  • 77
17
votes
1 answer

How to import and use com.sun.jdi.VirtualMachine

I found some classes designed for debugging in package com.sun.jdi like VirtualMachine, but I can't use this because package seems not exist in Sun JDK7. How to use this package? BTW. lib/sa-jdi.jar isn't the same I want
kbec
  • 3,415
  • 3
  • 27
  • 42
15
votes
4 answers

JDI Event Dispatch nullpointerexception

When I try to debug on my device I sometimes get an error and the debugger doesn't stop on any breakpoint. Also, the application doesn't even start properly, it just freezes at kinda black screen with the app icon and name at the top. The error is a…
Fungijl
  • 153
  • 1
  • 1
  • 7
12
votes
3 answers

An internal error occurred during: "JDI Event Dispatch" java.lang.NullPointerException

I have my java applet codee,I am trying to debug using eclipse Indigo EE. I am trying to debug on remote using debug configuration and port. When I try to execute the application, it gives always an error message, An internal error occurred during:…
JSD
  • 121
  • 1
  • 4
12
votes
1 answer

Implement different stratum for Java Debugger Interface

In the Java Debugger Interface documentation for the Location class, there's a paragraph discussing the "stratum" of the location. I've been looking around a bit for more detail on how one would go about implementing a new stratum (for, say, Scala…
jfager
  • 279
  • 1
  • 8
11
votes
1 answer

Java Debug Interface, Lambdas and Line Numbers

I am having some problems updating a debugger to work with Java 8. Consider the following program for example: public class Lam { public static void main(String[] args) { java.util.function.Function square = …
daveagp
  • 2,599
  • 2
  • 20
  • 19
8
votes
1 answer

DebuggerStepThrough equivalent for Java

.NET has a couple of handy annotations that instruct a debugger to step through/over certain methods. I would like to know if there is an equivalent that works on the Java platform. For instance: @DebuggerStepThrough public void foo() { …
Iulian Dragos
  • 5,692
  • 23
  • 31
6
votes
3 answers

JDI: How to pause a Java application (JVM) like in the debugger

I am looking for potentially a JDI API to pause the JVM at any arbitrary point during its execution. Looking at the BreakPointRequest createBreakpointRequest method needs a specific location. Is there any other API that does not need a location or…
anurag
  • 117
  • 1
  • 8
6
votes
1 answer

How to abort long running invokeMethod on com.sun.jdi.ObjectReference?

I have my own JDI Debugger which calls the toString method on some objects: com.sun.jdi.ObjectReferenceobject object = ... ThreadReference threadRef = frameProxy.threadProxy().getThreadReference(); Value value = object.invokeMethod(threadRef,…
Nfff3
  • 321
  • 8
  • 24
6
votes
0 answers

Java process to connect to its own debugger interface

Within a Java process, I want to access the JDI (Java Debugging Interface) of that same process. I make the following assumptions: The process is being executed within the debugger (in Intelli/J) I use the Oracle JVM 8 I run Linux (no portability…
Dominique Unruh
  • 1,248
  • 8
  • 23
4
votes
0 answers

JPDA MethodEntryEvent causing app to run very slow

I am trying to capture all method calls made in any android app. For that I am using JDI to register MethodEntryRequest for each running thread of the app. I am successful to do this, but I am facing the problem that the app becomes very very slow.…
rainyday
  • 353
  • 3
  • 17
4
votes
1 answer

ObjectReference underlying object in JDI and JPDA

Very specifically, in JDI and JPDA context, I have the following questions: Why ObjectReference does not expose its underlying object? Is it based on some specification? Are all implementations such as Eclipse Debug Project the same that do not…
nobeh
  • 9,784
  • 10
  • 49
  • 66
4
votes
2 answers

Java Access to Local Variable Names

I'm currently writing a program in which I would like to access the variable names of local variables during execution of a program and pass them off externally. I'm aware that Java will dump local variable names during compilation unless compiled…
cryptic_star
  • 1,863
  • 3
  • 26
  • 47
4
votes
2 answers

Can't run JDI trace example: Error: Could not find or load main class

I run in command line the following program as an example app: java -cp "D:\projects\PDFJavaFX\lib\PDFRenderer-0.9.1.jar" com/sun/pdfview/PDFViewer Then I run in command line the JDI trace example: java -cp "C:\Program …
Spiff
  • 3,873
  • 4
  • 25
  • 50
1
2 3 4 5 6 7 8