How to write native (i.e. C/C++) plugin for gdb?

Joel Brobecker brobecker@adacore.com
Tue Dec 24 14:47:00 GMT 2013


> I need to implement scenario like one below:
> 
> (gdb) load-plugin  libgdbjvm.so
> (gdb) attach PID
> (gdb) jvm show loaded-classes
> (gdb) jvm show java-threads
> (gdb) jvm show code-cache

Maybe you could add some routines in your program that are solely
intended for debugging purposes, and then define commands that
call those routines. Off hand, that's the only way I can think of.
Otherwise, interface the C++ stuff you need from Python - if necessary,
export some stuff to C?

-- 
Joel



More information about the Gdb mailing list