From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9629 invoked by alias); 8 May 2012 14:38:32 -0000 Received: (qmail 9454 invoked by uid 22791); 8 May 2012 14:38:31 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-yw0-f41.google.com (HELO mail-yw0-f41.google.com) (209.85.213.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 May 2012 14:38:17 +0000 Received: by yhr47 with SMTP id 47so6654159yhr.0 for ; Tue, 08 May 2012 07:38:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.72.133 with SMTP id t5mr23919997yhd.94.1336487896853; Tue, 08 May 2012 07:38:16 -0700 (PDT) Received: by 10.236.200.202 with HTTP; Tue, 8 May 2012 07:38:16 -0700 (PDT) In-Reply-To: References: <87vck7wxs7.fsf@fleche.redhat.com> Date: Tue, 08 May 2012 14:38:00 -0000 Message-ID: Subject: Re: GDB plugin From: Matt Rice To: Hui Zhu Cc: Tom Tromey , Abhijit Halder , "gdb-patches@sourceware.org ml" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00229.txt.bz2 On 5/7/12, Hui Zhu wrote: > On Tue, May 8, 2012 at 4:18 AM, Tom Tromey wrote: >>>>>>> "Abhijit" == Abhijit Halder writes: >> >> Abhijit> Is there any way to load a GDB plugin (shared library having >> extended >> Abhijit> functionality) in current GDB? I am planning to develop one. >> Need >> Abhijit> yours opinion on this. >> >> There is a little bit of this for the JIT functionality. >> >> Generic plugins are trouble because they tend to fix the API -- but we >> want to be able to change the API as needed. The JIT approach avoided >> this by exporting a custom, minimal API. >> >> What exactly are you planning to do? >> >> Tom > > I think the api is not a big trouble, the Linux kernel's api is always > change. But lkm is still alive. I use some ifdef to make KGTP can be > work from 2.6.18 to upstream. I think if GDB can supply some > interface to get the api version, support different api is not very > hard. all but a few of the kernel modules are actually shipped with the kernel though. nor does the kernel have a python interpreter embedded in it. I once saw some code which attempted to be compatible with various versions of gdb and it was not pretty. here's the commit where they decided to remove all of that and stick to a single gdb version. http://mspgcc.git.sourceforge.net/git/gitweb.cgi?p=mspgcc/gdb;a=commit;h=078b594406e6257930b3d6e66f226e9725cea874 personally I think it's just going to be a pain for those who write plugins, much more so than the effort of putting things upstream, we should encourage that, not lead them into some #ifdef death trap.