This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB and the OpenJDK JVM


On Tue, 2012-02-07 at 14:58 -0500, Daniel Jacobowitz wrote:
> Has anyone investigated non-trivial integration between GDB and this
> (or any other) JVM?  So far I haven't turned up anything useful.  Some
> examples of the sorts of integration I mean:
> 
> * Showing information about Java objects given JNI handles
> * Interleaving Java frames in the stack trace
> * Fabricating unwind information for JIT'd code
> * Automatically handling SEGVs related to the garbage collector
> without hiding SEGVs for native code

For SystemTap I wrote some hotspot heap introspection functions that
might be interesting. But, like Gary said, hotspot might have internal
debug accessor functions that you can use too. Systemtap cannot call
into the inferior so we needed some code that went through the java code
heap and stack unwind "by hand":
http://icedtea.classpath.org/hg/icedtea6/file/tip/tapset/jstack.stp.in
If you can make inferior function calls however (and know it is safe to
call them) then that will be much easier. The above systemtap tapset is
somewhat fragile since it depends on a lot of hotspot code generator
internals.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]