This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB and the OpenJDK JVM
On Thu, Feb 9, 2012 at 4:15 PM, Philippe Waroquiers
<philippe.waroquiers@skynet.be> wrote:
>
> 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
It's primarily a matter of context. When you have a C++ debugger
attached to the JVM, also communicating with it on a socket is quite
tricky - we'd have to let the debug thread run, and hope it didn't
deadlock with some other stopped thread. I want to expose the JVM
details while intrusively debugging the encompassing program.
Also I am not sure you can get things at the level of a JNI handle
over JWDP; those don't exist when you're looking at inside the VM.
We'd still need some way to associate the C++ jobject handles with VM
entities.
> 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."
Yes, this is very closely related to what I want to do. I wonder if
it requires changes to HP's JDK... I do not see references to
libjunwind outside of HP-UX.
--
Thanks,
Daniel