From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9007 invoked by alias); 24 Dec 2013 14:47:11 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 8996 invoked by uid 89); 24 Dec 2013 14:47:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 24 Dec 2013 14:47:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 086A61164FF; Tue, 24 Dec 2013 09:47:07 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zerJAyfa6txS; Tue, 24 Dec 2013 09:47:06 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 748861164D1; Tue, 24 Dec 2013 09:47:06 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 23CC5E07B7; Tue, 24 Dec 2013 18:47:04 +0400 (RET) Date: Tue, 24 Dec 2013 14:47:00 -0000 From: Joel Brobecker To: Dmitry Samersoff Cc: Hui Zhu , "gdb@sourceware.org" Subject: Re: How to write native (i.e. C/C++) plugin for gdb? Message-ID: <20131224144704.GJ4558@adacore.com> References: <52B97EB4.9070100@samersoff.net> <52B9966B.8050104@samersoff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52B9966B.8050104@samersoff.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-12/txt/msg00078.txt.bz2 > 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