From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3184 invoked by alias); 6 Nov 2002 15:54:05 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3167 invoked from network); 6 Nov 2002 15:54:03 -0000 Received: from unknown (HELO smtp.hccnet.nl) (62.251.0.13) by sources.redhat.com with SMTP; 6 Nov 2002 15:54:03 -0000 Received: from charis.vernstok by smtp.hccnet.nl via fia16-123.dsl.hccnet.nl [62.251.123.16] with ESMTP id QAA07516 (8.8.8/1.13); Wed, 6 Nov 2002 16:53:38 +0100 (MET) Received: from jelmer by charis.vernstok with local (Exim 3.36 #1 (Debian)) id 189STA-0000f5-00; Wed, 06 Nov 2002 16:51:52 +0100 Date: Wed, 06 Nov 2002 07:54:00 -0000 From: Jelmer Vernooij To: Scott Moser Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [PATCH] plugin patch Message-ID: <20021106155151.GA2522@charis.vernstok> References: <20021106145415.GA2350@charis.vernstok> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: Linux charis 2.4.18-686 X-SW-Source: 2002-11/txt/msg00099.txt.bz2 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