Questions tagged [jvmti]

JVMTI is the Java Virtual Machine Tool Interface, a native API by which authors can write JVM plugins to monitor or modify the execution of a Java Virtual Machine.

Documentation for the current JVMTI 1.2. Home page for JVMTI in JDK 7.

JVMTI was introduced in JDK 5. It replaces Java Virtual Machine Profiler Interface (JVMPI) and the Java Virtual Machine Debug Interface (JVMDI).

214 questions
1
vote
1 answer

Undefined symbol in shared library with g++

With JVMTI I am developing an agent to profile Java applications. Therefore a shared library libagent.so is compiled. Further I use the Qt framework: For now it consists only by these two source files: agent.cpp and agentserver.cpp However, when…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
1
vote
2 answers

Reinitializing Java Class

We are working on a JVMTI Java Agent, that is used to instrument java class files. A small part of it is (obviously) native c++ code, but the larger part is Java code, which is loaded over the network and called from the native agent code. We use a…
Ron
  • 682
  • 6
  • 7
1
vote
1 answer

GUI on top of a JVMTI agent

I am planing to develop a profiler by using the JVMTI API provided by Oracle. For a visualization I would like to implement a GUI (Qt framework) on top of the agent code. My first jvmti agent is aready compiling and running and I started to…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
1
vote
2 answers

Build JVMTI Agent with Qt/qmake

After I successfully implemented my first JVMTI agent and the building completes with the g++ compiler I want to go over integrate the building process into my Qt project. However I am facing some build process configuration issues: The parameters I…
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
1
vote
0 answers

Communication between java VMs via native JVMTI agent

I am trying to communicate from a java application with a different java virtual machine via an JVMTI attached agent (C++). The basic idea is to attach the agent from VM A to VM B via the Attach API…
Max M.
  • 11
  • 2
1
vote
2 answers

determine Java class size from JNI jclass

I'm using JNI to analyze some program. I just wonder, after get jclass reference, how it is possible to find the size of the underlying class ? for example: class cls = env->FindClass("Lee/Boehm/Test"); from here how can i evaluate the size of the…
boehm
  • 13
  • 4
1
vote
0 answers

How to Access JVM Operand Stack

I am writing a Java debugger which needs to access operand stack. Basically, I am trying to record execution trace of a Java program with JPDA (https://docs.oracle.com/javase/7/docs/technotes/guides/jpda/index.html). For each trace step, I would…
Yun Lin
  • 11
  • 4
1
vote
1 answer

Using JVMTI to change Java bytecode at a runtime with C++

I would like to know if anyone has had any luck modifying a Java methods bytecode at a run-time with JVMTI. JVMTI has a getter for a methods bytecode, but from what I understand it does not have any support for replacing the buffer. Any information…
1
vote
2 answers

JVMTI _jclass toString

How to get the name of the JVM TI _jclass? I want to display names of classes loaded in the JVMTI agent, however it is not obvious to me how to get the name of a class from a _jclass instance.
paweloque
  • 18,466
  • 26
  • 80
  • 136
1
vote
1 answer

Resolving Dependencies in JNI DefineClass

I am writing an application using the JVMTI. I am trying to instrument the bytecode: by injecting method calls on every method entry. I know how to do that, but the problem is in the instrument class, say it's called Proxy, which I load using the…
xuq01
  • 588
  • 4
  • 17
1
vote
2 answers

C getting functions address

In my project i am implementing a JNI agent which would rebind all java native methods to my customized methods in my custom ".c" file. So since JNI agent binds native methods in runtime, i will be only talking about runtime solution. When JNI…
Aksim Elnik
  • 425
  • 6
  • 27
1
vote
1 answer

Communication between JVMTI agent and separate JVM

First off i apologize as this is somewhat answered already here, but I think my situation is a bit different. How to communicate with jvmti agent attached on a running JVM My main question is... I am wondering if there are anyways using the JNI or…
Ralph Emerson
  • 113
  • 2
  • 9
1
vote
0 answers

JVM crashing EXCEPTION_ACCESS_VIOLATION (0xc0000005) :problematic frame in jvmti agent

I wrote a JVMTI agent and upon running an application with the particular jvmti agent, the jvm crashes and exits with EXCEPTION_ACCESS_VIOLATION (0xc0000005). Problematic frame lies in the jvmti agent that I wrote. The stacktrace showed some jni…
Debugger
  • 21
  • 4
1
vote
1 answer

JNI passing a long value to a native method

So as described above I am trying to copy an int object into off-heap memory with the help of Unsafe. Here is my main function: public static void main(String[] args) throws Exception { UnsafeHelper hlpr = new UnsafeHelper(); int original…
Aksim Elnik
  • 425
  • 6
  • 27
1
vote
1 answer

Running the custom Debugger JAVA

I am trying to run the custom debugger agent which is written in C++ using the JVMTI interface. I followed the following link Creating a Debugging and Profiling Agent with JVMTI I am trying to run the debugger which is present in the demo folder of…
kumarD
  • 574
  • 2
  • 9
  • 23