This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB and the OpenJDK JVM
On Thu, 2012-02-09 at 15:47 -0500, Daniel Jacobowitz wrote:
> On Thu, Feb 9, 2012 at 3:21 PM, Philippe Waroquiers
> <philippe.waroquiers@skynet.be> wrote:
> > On google, the keywords 'java debugger interface' points at some
> > "standardised" documents (including a "wire protocol") aiming at
> > connecting a debugger to a JVM.
>
> That's something completely different - how to talk to the JVM for
> bytecode or source level debugging of the code running on the VM. I'm
> talking about debugging the underlying JVM in order to debug native
> code such as JNI.
>
> Now, it might be possible to simultaneously control the VM using
> ptrace and let enough of it free-run to speak JDWP to it. It would be
> a bit of a trick, though... I wouldn't even raise the idea if non-stop
> weren't so far along.
>
I am not sure I fully understand the difference between bytecode
debugging/source level debugging of the code running on the VM
and e.g.
>> * Showing information about Java objects given JNI handles
>> * Interleaving Java frames in the stack trace
>> * Fabricating unwind information for JIT'd code
You might also take a look at a recent version of hp wdb (hp modified
gdb). IIUC, it has some support for mixed Java and other lang debugging.
E.g. here is an extract of the manual:
"Using WDB to examine backtraces in JavaTM thread stacks
You can now use HP's debugger WDB 3.0.01 or later (the GNU Debugger GDB) to
examine backtraces containing mixed language frames (JavaTM and C/C++) in JavaTM
thread stacks. This will simplify debugging the VM and JavaTM mixed-language
applications. Set the environment variable GDB_JAVA_UNWINDLIB to the path name
of the JavaTM Unwind Shared Library libjunwind, which is in the JDK."
(sorry if I point again at useless info due to my misunderstanding of
your objectives).
Philippe