I have been asked to debug some C++ shared library that relies on Java libraries by loading an embedded Java virtual machine. The invocation API of the Java Native Interface (JNI) is used for that purpose.
The JVM is loaded using the JNI_CreateJavaVM
and Java components are then invoked from C++.
I have the source code for both Java and C++ libraries.
I am using gdb as my debugger (I am working on a remote Linux environment) but it doesn't seem to support stepping in the invoked Java code.
My question is, are there any tool or workaround that could make that possible?
Note: My question is similar to a previous one posted in 2017, How to debug Java code running inside native code-created JVM?. However, the answer focuses on using Eclipse.