From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6424 invoked by alias); 26 Dec 2013 22:55:42 -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 6414 invoked by uid 89); 26 Dec 2013 22:55:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vb0-f46.google.com Received: from mail-vb0-f46.google.com (HELO mail-vb0-f46.google.com) (209.85.212.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 26 Dec 2013 22:55:40 +0000 Received: by mail-vb0-f46.google.com with SMTP id w20so4349324vbb.19 for ; Thu, 26 Dec 2013 14:55:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+Z5HRTY78kqet8elF/ccuBl48QU/sGE6jOjtzgBMOLk=; b=MOHLB1kL/dTlZuFNAUTSMVM61w/on7BKYm7O8VBEVHV1oJw2Ngkxj+C4MVPRUnCGY4 FUy9KpIGUYysxT25gXnZ/GqIdZ2pz/cuHhJft3noxvBdzSU/YxpjFkqqU8ewIdqIWaXU 2xK+gV/tywdmkwnfUwqWrlAJiydu5N/cPoNFGQ9l8IqLI8xEBsdkIBCEnFy1rbVoUhgA 6IWyjCflMK+oDS7DCYOUn1w0RWVXlYNwyrV2IXx8e96gy5soWL67Hba6JPZ/m9U0uHQ4 sYk6+A2PN9xHgA0QIaYmqlhtGkDRgDcnx+l1I808aMG8hGQLsYWJrbaiKmJD+eSlytUg UjBQ== X-Gm-Message-State: ALoCoQkhRN0M0E0geKfhRtBu0xRcJXvucEOqkr9pOY+Wsw2pc0bkwImyNlXR0Qbr2iG+JU4LGokfCa41+Ch29eVXpaSfxDYrmh3DbtQDQwniEhfeHflC0ii31GH9yDvc+RWvCkW1cdvwgEm+vc5Q4LWnAAbZFQ+EkN/uGrxWIKYQVaPh87uU+07Ht+e1nu4xlJiB1tcGJr90 MIME-Version: 1.0 X-Received: by 10.58.4.138 with SMTP id k10mr12325401vek.8.1388098537891; Thu, 26 Dec 2013 14:55:37 -0800 (PST) Received: by 10.52.248.65 with HTTP; Thu, 26 Dec 2013 14:55:37 -0800 (PST) In-Reply-To: <52BB0D06.3000208@samersoff.net> References: <52B97EB4.9070100@samersoff.net> <52B9966B.8050104@samersoff.net> <20131224144704.GJ4558@adacore.com> <52BAFA96.8060407@samersoff.net> <52BB0D06.3000208@samersoff.net> Date: Thu, 26 Dec 2013 22:55:00 -0000 Message-ID: Subject: Re: How to write native (i.e. C/C++) plugin for gdb? From: Doug Evans To: Dmitry Samersoff Cc: Joel Brobecker , Hui Zhu , "gdb@sourceware.org" , Abhijith Halder Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00082.txt.bz2 On Wed, Dec 25, 2013 at 8:51 AM, Dmitry Samersoff wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Everyone, > > Just found a year old discussion about Abhijit proposal. > > So answering to upcoming question - why not a Python. > > Python is very good staff if your speak about source level debugging. > If you have to debug optimized binary python doesn't help match for > two reason - > > 1) you have to port all native data structure you plan to work with > to python. Hi. This typically isn't that hard an exercise, have you looked into it? > 2) python performance is not always acceptable and you not always > ever able to run a python. I'd like to see the data that shows the performance isn't acceptable. This could just be mistaken impressions. > To get a better picture of native plugins in action, please, take a > look at solaris mdb. > > - -Dmitry > > On 2013-12-25 19:32, Dmitry Samersoff wrote: >> Joel, >> >> Thank you for the response. >> >> I found this patch >> https://sourceware.org/ml/gdb-patches/2012-05/msg00500.html - many >> thanks to Abhijit. >> >> 1. What is the reason to keep it off main trunk? Is there a chance >> to have it changed? >> >> 2. What API is available from within a plugin? i.e. how I can >> access coredump memory? >> >> -Dmitry >> >> On 2013-12-24 18:47, Joel Brobecker wrote: >>>> 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? >> >> >> >> > > - -- > Dmitry Samersoff > Saint Petersburg, Russia, http://devnull.samersoff.net > * There will come soft rains ... > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.20 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQEcBAEBAgAGBQJSuw0GAAoJEHEy08c4gIABbiwIAJJlEmMZ16o3JJibuY7X5sLL > VOVxfJfMox78zaGERdrS/lQqFege+JN1qBcaVjg4HGbSl71aA0t11JR6W+Vv06UZ > JK82axJqDkR2hOjz8oy9LeZNGOgLeE1zcjCwYVbyuj7hhENaDBZTadq94pc5dOsi > aBAVqPrDe9ufgBeriHD5uym1lwYEk4EOW8jBEU4ToO5PUUtVTIG6i4WeXjwMBAxh > z1ZCRR46WRXKpL1LQw6X6jOWpXL/6nnoS3A9j4zKGXG8xHiM8K8zyrZPBRsB26A8 > t+FLEPeFg7pAuARnlDNLaEHX4lEjifqoGafyw7L+KbVPdC1INYQ+Ld8Q+yg/jMg= > =baN/ > -----END PGP SIGNATURE-----