This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to write native (i.e. C/C++) plugin for gdb?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Dmitry Samersoff <dms at samersoff dot net>
- Cc: Hui Zhu <teawater at gmail dot com>, "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Tue, 24 Dec 2013 18:47:04 +0400
- Subject: Re: How to write native (i.e. C/C++) plugin for gdb?
- Authentication-results: sourceware.org; auth=none
- References: <52B97EB4 dot 9070100 at samersoff dot net> <CANFwon3gOuaopfsJ_Eord=14U__zD2JrBorKz_4bMBYPtZy4cQ at mail dot gmail dot com> <52B9966B dot 8050104 at samersoff dot net>
> 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