This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
GDB plugins/extensions with libGDB.so
- From: Scott Moser <ssmoser at us dot ibm dot com>
- To: gdb at sources dot redhat dot com
- Date: Tue, 17 Sep 2002 17:44:56 -0500 (CDT)
- Subject: GDB plugins/extensions with libGDB.so
Hello all,
A while ago I sent a mail to the list about GDB and plugins
(http://sources.redhat.com/ml/gdb/2002-04/msg00371.html). I've got a
patch that allows something very similar to what I described. However,
the functionality as it stands only works on linux or other systems that
allow dlsym()ing back into the main executable (as long as you compile
with -rdynamic, which gdb already does). I tested also on freebsd, but
I know it doesn't work on windows, and I'd guess isn't very cross
platform in general. I can submit it if someone is interested.
Relying on such rare behavior probably isn't a good idea for gdb, but
I think that extensions/plugins are a good idea. In my personal
experience I've come across a couple people that expressed interest in
such functionality and saw other interest on the list
(http://sources.redhat.com/ml/gdb/2002-05/msg00260.html).
I think the best way to go about allowing extensions of GDB is to go
the libgdb route. Basically /usr/bin/gdb would just be a the executable
which gets most/all its functionality out of /usr/lib/libGDB.so, which
extensions could then call back into in a very cross platform manner
with dlopen and dlsym. I've successfully hand-built on linux in this
manner to make sure it worked, but don't have a full scale build process
together.
To do this well, I think the best method would be to finish the TODO
item and Automake-ify the gdb process and get libGDB.so built with
libtool. I've taken a look at this a bit, but not being very familiar
with the autotools, its not going too fast. (Is anyone else working on
this? )
I could be either making this much too complicated, or not
complicated enough. If I'm doing either, please let me know.
What do people think about jump-starting the libGDB idea and getting
"plugin" support into GDB all at once?
Scott Moser
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-1533 T/L: 678-1533
ssmoser@us.ibm.com , internal zip: 9812