Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Dmitry Samersoff <dms@samersoff.net>
Cc: Joel Brobecker <brobecker@adacore.com>,
	Hui Zhu <teawater@gmail.com>,
		"gdb@sourceware.org" <gdb@sourceware.org>,
	Abhijith Halder <abhijit.k.halder@gmail.com>
Subject: Re: How to write native (i.e. C/C++) plugin for gdb?
Date: Thu, 26 Dec 2013 22:55:00 -0000	[thread overview]
Message-ID: <CADPb22Sicg2Z6bsqWYq9Ok5FmijcH9+qmnSkMJXnUETRfeZeHQ@mail.gmail.com> (raw)
In-Reply-To: <52BB0D06.3000208@samersoff.net>

On Wed, Dec 25, 2013 at 8:51 AM, Dmitry Samersoff <dms@samersoff.net> 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-----


  reply	other threads:[~2013-12-26 22:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 12:31 Dmitry Samersoff
2013-12-24 13:16 ` Hui Zhu
2013-12-24 14:13   ` Dmitry Samersoff
2013-12-24 14:47     ` Joel Brobecker
2013-12-25 15:32       ` Dmitry Samersoff
2013-12-25 16:51         ` Dmitry Samersoff
2013-12-26 22:55           ` Doug Evans [this message]
2013-12-27 14:15             ` Dmitry Samersoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADPb22Sicg2Z6bsqWYq9Ok5FmijcH9+qmnSkMJXnUETRfeZeHQ@mail.gmail.com \
    --to=dje@google.com \
    --cc=abhijit.k.halder@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=dms@samersoff.net \
    --cc=gdb@sourceware.org \
    --cc=teawater@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox