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
0 answers

How to exclude non-project classes from Step Event in JVMTI?

Currently this is how I generate Step events: ... capabilities.can_generate_single_step_events = 1; ... callbacks.SingleStep = SingleStep; jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL); And then the…
Nfff3
  • 321
  • 8
  • 24
1
vote
0 answers

How to put non-blocking breakpoint in JDI (Java Debug Interface)?

When you have a BreakpointEvent or StepEvent in JDI (Java Debug Interface), what happens is that the currently executing program(debugee) is suspended until the debugger processes the breakpoint event and resumes the debugee. But if you have many…
Nfff3
  • 321
  • 8
  • 24
1
vote
0 answers

JDI: Error when I use WindowsManager.closeWindow()

I try to use WindowsManager.closeWindow() after test suite. Window close, but then I have error. My code: @Test public void monitoringMenuTest() { sidebar.select(Monitoring, Chart); chartPage.checkOpened(); sidebar.select(Monitoring,…
1
vote
1 answer

JDI: How to get the ObjectReference value?

I am using the JDI to recode the variable status in the method. According to the tutorial, I am not found how to get objectReference value, like List, Map or my custom class. It just can get PrimtiveValue. StackFrame stackFrame = ((BreakpointEvent)…
Xin
  • 55
  • 1
  • 6
1
vote
0 answers

How to suspend the current JVM programmatically and wait for a debugger to connect?

My goal is to implement a small library in Java that would allow to programmatically take some actions and then suspend the current JVM until a debugger is connected to it. I imagine parts of it at least are possible, for ex. when starting a JVM in…
eugen
  • 5,856
  • 2
  • 29
  • 26
1
vote
1 answer

Can't find com.sun.jdi in Jboss

Hey Everyone! I keep getting ClassNotFound exception on Sun.Jdi in the Jboss EAP 7. It is used by a HotswapAgent thus I want to know how to add com.sun.jdi to the Jboss either via module loader or someway else. 18:16:48,158 INFO …
Bakar
  • 383
  • 1
  • 9
  • 27
1
vote
0 answers

JDI EventRequestManager max EventRequests

Hy, i wrote a litte Quick and Dirty Code Coverage analyser for Java SE using JDI. It sets a Breakpoint for every Location it can find for certain Classes or Packages. And i now wonder how much EventRequests this class:…
maxbit89
  • 748
  • 1
  • 11
  • 31
1
vote
0 answers

Java JDI ReferenceType get absolute path

Is it possible to get the absolute file path from a ReferenceType in JDI? I am wanting to list all line locations for a specific class, but the class is pulling in multiple reference types, so I want to be able to determine which one it is. These…
Silas
  • 201
  • 4
  • 16
1
vote
1 answer

JDI apply class filters for multiple classes

I am creating a MethodEntryRequest, and I want to apply this request to only methods of two class patterns for ex:- "java.*" and "sun.*". For that I had written following code. MethodEntryRequest menr =…
rainyday
  • 353
  • 3
  • 17
1
vote
1 answer

Java: Method hooking & Finding object instances

Situation Hi, I have 2 problems. The situation is that I'm writing a Java API for Windows that also provides tools for injecting code into a process and then manipulate the target. I have already implemented the injection-part, for example injecting…
Zabuzard
  • 25,064
  • 8
  • 58
  • 82
1
vote
1 answer

How do you set a breakpoint before executing

I would like to set a breakpoint in an application before it starts to run, so that I can make sure the application does not pass the breakpoint on startup. In order to set a breakpoint you need to do something like: EventRequestManager reqMan =…
Victor Grazi
  • 15,563
  • 14
  • 61
  • 94
1
vote
1 answer

During debugging, how to evaluate a piece of code in the debug target VM?

During debugging, e.g. in Eclipse, one can evaluate Watch Expressions or Conditional Breakpoints. Typically, these are evaluated on the client side. For instance, when debugging from within Eclipse, it is Eclipse itself, not the debug target VM that…
user66237
  • 793
  • 1
  • 5
  • 19
1
vote
1 answer

Loss of an element from hashtable using JDI

I have declared and initialized these hashtable: Hashtable ht = new Hashtable(); ht.put("due", 2); ht.put("tre", 3); ht.put("uno", 1); Hashtable ht = new Hashtable(); …
Gil
  • 11
  • 3
1
vote
1 answer

How to access the statement object (of each line of code) when using JDI?

I am writing a program to step through Java code using JDI. I am now at the point where I can inspect the values of all the variables that I care about at any given moment. Now, I want to be able to inspect the nature of each line of code (that is…
thammaknot
  • 63
  • 7
1
vote
2 answers

JDI - IllegalConnectorArgumentsException: Argument invalid

I am using the JDI to debug another running java application. What I do that works: Run two applications using Eclipse. The debugger is launched with the following VM Options: -Xdebug…
Dean Leitersdorf
  • 1,303
  • 1
  • 11
  • 22