This is the mail archive of the gdb-patches@sources.redhat.com 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: [PATCH] plugin patch


On Wed, Nov 06, 2002 at 09:13:44AM -0600, Scott Moser wrote about 'Re: [PATCH] plugin patch':
> On Wed, 6 Nov 2002, Jelmer Vernooij wrote:

> > On Wed, Nov 06, 2002 at 08:45:18AM -0600, Scott Moser wrote about 'Re: [PATCH] plugin patch':

> > >    If my patch was submitted incorrectly, there was something else
> > > that I was missing, or anything else I'd need to change/update/add,
> > > please let me know.
> > One small suggestion; add some kind of version system for the plugins.
> > The API for plugins might change in the future and you don't want bug
> > reports from users complaining that gdb segfaults when they're trying
> > to load a plugin. We had the same thing when implementing this in
> > samba.

>    While its not by any means ideal due to the changing format of the
> GDB version, the patch did have a method for a plugin to require a
> specific version of GDB.
>    when the plugin is loaded, its passed the gdb version (from
> gdb/version.in).  If it decides it can't work with that version, then it
> can return false and the plugin loader will say "failed to load".
>    This way, the weight is on the plugin to decide if it can run or not,
> rather than GDB.  Is that something like what you were looking for?
Plugins won't "know" the API that is used in newer versions of GDB, so
they can't really decide whether they are or are not compatible with
it. Only allowing plugins to be loaded with _exactly_ the same version 
as the gdb they are loaded into works well (same way the linux kernel
does).

If the plugins are using a small number of functions only, you
might want to consider using an API version number - whenever one of
these functions changes, you increase the version number. This would
allow plugins from various gdb versions (but with the same API
version) to be used without the need of recompiling.

Jelmer


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