* GDB plugin
@ 2012-05-07 16:21 Abhijit Halder
2012-05-07 20:18 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Abhijit Halder @ 2012-05-07 16:21 UTC (permalink / raw)
To: gdb-patches@sourceware.org ml
Hi all,
Is there any way to load a GDB plugin (shared library having extended
functionality) in current GDB? I am planning to develop one. Need
yours opinion on this.
Thanks,
Abhijit Halder
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-07 16:21 GDB plugin Abhijit Halder
@ 2012-05-07 20:18 ` Tom Tromey
2012-05-08 5:46 ` Abhijit Halder
2012-05-08 6:38 ` Hui Zhu
0 siblings, 2 replies; 13+ messages in thread
From: Tom Tromey @ 2012-05-07 20:18 UTC (permalink / raw)
To: Abhijit Halder; +Cc: gdb-patches@sourceware.org ml
>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-07 20:18 ` Tom Tromey
@ 2012-05-08 5:46 ` Abhijit Halder
2012-05-08 14:20 ` Tom Tromey
2012-05-08 22:06 ` André Pönitz
2012-05-08 6:38 ` Hui Zhu
1 sibling, 2 replies; 13+ messages in thread
From: Abhijit Halder @ 2012-05-08 5:46 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches@sourceware.org ml
On Tue, May 8, 2012 at 1:48 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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?
>
I am planning to introduce a pluggin command in GDB which will give a
flexibility to a GDB user to develop his/her own GDB extension (e.g.
GDB-ext.so). The extension may have new and/or extended functionality
like support for new languages and platforms and custom GDB-command.
The extension can be loaded by this newly proposed plugin command.
I am not completely aware of the limitation of this approach, but it
makes me happy thinking that the GDB users who want to extend GDB
functionality but are not well accustomed with GDB source code, can
still write their own pluggins and use an enhanced GDB without the
pain of recompilation of entire GDB source code.
Thanks,
Abhijit Halder
> Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-07 20:18 ` Tom Tromey
2012-05-08 5:46 ` Abhijit Halder
@ 2012-05-08 6:38 ` Hui Zhu
2012-05-08 13:46 ` Tom Tromey
2012-05-08 14:38 ` Matt Rice
1 sibling, 2 replies; 13+ messages in thread
From: Hui Zhu @ 2012-05-08 6:38 UTC (permalink / raw)
To: Tom Tromey; +Cc: Abhijit Halder, gdb-patches@sourceware.org ml
On Tue, May 8, 2012 at 4:18 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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.
Thanks,
Hui
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 6:38 ` Hui Zhu
@ 2012-05-08 13:46 ` Tom Tromey
2012-05-08 14:38 ` Matt Rice
1 sibling, 0 replies; 13+ messages in thread
From: Tom Tromey @ 2012-05-08 13:46 UTC (permalink / raw)
To: Hui Zhu; +Cc: Abhijit Halder, gdb-patches@sourceware.org ml
>>>>> ">" == Hui Zhu <teawater@gmail.com> writes:
>> 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.
I'm skeptical, but I suppose as long as the rule is "if it breaks, too
bad", then it is ok.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 5:46 ` Abhijit Halder
@ 2012-05-08 14:20 ` Tom Tromey
2012-05-08 15:05 ` Joel Brobecker
2012-05-08 22:06 ` André Pönitz
1 sibling, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2012-05-08 14:20 UTC (permalink / raw)
To: Abhijit Halder; +Cc: gdb-patches@sourceware.org ml
>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> writes:
Abhijit> I am planning to introduce a pluggin command in GDB which will give a
Abhijit> flexibility to a GDB user to develop his/her own GDB extension (e.g.
Abhijit> GDB-ext.so). The extension may have new and/or extended functionality
Abhijit> like support for new languages and platforms and custom GDB-command.
Abhijit> The extension can be loaded by this newly proposed plugin command.
Abhijit> I am not completely aware of the limitation of this approach, but it
Abhijit> makes me happy thinking that the GDB users who want to extend GDB
Abhijit> functionality but are not well accustomed with GDB source code, can
Abhijit> still write their own pluggins and use an enhanced GDB without the
Abhijit> pain of recompilation of entire GDB source code.
I think most users are better off writing extensions in Python.
We can expose more internals to Python as needed for this.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 6:38 ` Hui Zhu
2012-05-08 13:46 ` Tom Tromey
@ 2012-05-08 14:38 ` Matt Rice
2012-05-08 14:47 ` Paul_Koning
1 sibling, 1 reply; 13+ messages in thread
From: Matt Rice @ 2012-05-08 14:38 UTC (permalink / raw)
To: Hui Zhu; +Cc: Tom Tromey, Abhijit Halder, gdb-patches@sourceware.org ml
On 5/7/12, Hui Zhu <teawater@gmail.com> wrote:
> On Tue, May 8, 2012 at 4:18 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 14:38 ` Matt Rice
@ 2012-05-08 14:47 ` Paul_Koning
2012-05-08 14:58 ` Matt Rice
0 siblings, 1 reply; 13+ messages in thread
From: Paul_Koning @ 2012-05-08 14:47 UTC (permalink / raw)
To: ratmice; +Cc: teawater, tromey, abhijit.k.halder, gdb-patches
On May 8, 2012, at 10:38 AM, Matt Rice wrote:
> On 5/7/12, Hui Zhu <teawater@gmail.com> wrote:
>> On Tue, May 8, 2012 at 4:18 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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'm confused. GDB is not a kernel component, so a GDB plugin isn't a kernel module. How did lkm get brought into the discussion?
Extending GDB can done in a number of ways, but the Python way is quite flexible and easy when the things you need are available in its API. And if they aren't, they can be added.
paul
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 14:47 ` Paul_Koning
@ 2012-05-08 14:58 ` Matt Rice
0 siblings, 0 replies; 13+ messages in thread
From: Matt Rice @ 2012-05-08 14:58 UTC (permalink / raw)
To: Paul_Koning; +Cc: teawater, tromey, abhijit.k.halder, gdb-patches
On 5/8/12, Paul_Koning@dell.com <Paul_Koning@dell.com> wrote:
>
> On May 8, 2012, at 10:38 AM, Matt Rice wrote:
>
>> On 5/7/12, Hui Zhu <teawater@gmail.com> wrote:
>>> On Tue, May 8, 2012 at 4:18 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> 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'm confused. GDB is not a kernel component, so a GDB plugin isn't a kernel
> module. How did lkm get brought into the discussion?
it was used as an example of an unstable API
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 14:20 ` Tom Tromey
@ 2012-05-08 15:05 ` Joel Brobecker
2012-05-08 15:21 ` Mark Kettenis
0 siblings, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2012-05-08 15:05 UTC (permalink / raw)
To: Tom Tromey; +Cc: Abhijit Halder, gdb-patches@sourceware.org ml
> I think most users are better off writing extensions in Python.
> We can expose more internals to Python as needed for this.
I very much agree.
--
Joel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 15:05 ` Joel Brobecker
@ 2012-05-08 15:21 ` Mark Kettenis
0 siblings, 0 replies; 13+ messages in thread
From: Mark Kettenis @ 2012-05-08 15:21 UTC (permalink / raw)
To: brobecker; +Cc: tromey, abhijit.k.halder, gdb-patches
> Date: Tue, 8 May 2012 08:05:10 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> > I think most users are better off writing extensions in Python.
> > We can expose more internals to Python as needed for this.
>
> I very much agree.
Same here.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 5:46 ` Abhijit Halder
2012-05-08 14:20 ` Tom Tromey
@ 2012-05-08 22:06 ` André Pönitz
2012-05-09 4:28 ` Abhijit Halder
1 sibling, 1 reply; 13+ messages in thread
From: André Pönitz @ 2012-05-08 22:06 UTC (permalink / raw)
To: Abhijit Halder; +Cc: gdb-patches@sourceware.org ml
On Tue, May 08, 2012 at 11:16:11AM +0530, Abhijit Halder wrote:
> [...] I am not completely aware of the limitation of this approach,
> but it makes me happy thinking that the GDB users who want to extend
> GDB functionality but are not well accustomed with GDB source code,
> can still write their own pluggins and use an enhanced GDB without the
> pain of recompilation of entire GDB source code.
I guess I fit the bill of a "user[s] who want to extend GDB
functionality but are not well accustomed with GDB source code"
rather well. It's something I've been doing for quite a while now.
However, the idea of writing plugins for GDB is not exactly
appealing to me.
For one. the "pain of recompilation of entire GDB source code" you
mention does not exist. It's a straight-forward ./configure &&
make, not even with enough waiting time for a successful trip to
the coffee maker (Unless you are on Windows and need to build all
dependencies, but that would not be different for plugins)
Secondly, GDB is pretty extensible using Python scripting already,
giving "zero compile time" and platform independent access to a lot
of functionality. It's hard to see how compiled plugins would
improve that situation. I'd rather expect the effort for creating
and maintaining a plugin interface to eat into the already scarce
resources of the developers, for really not much benefit.
So, please, pretty please, can we drop the idea? ;-)
Andre'
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: GDB plugin
2012-05-08 22:06 ` André Pönitz
@ 2012-05-09 4:28 ` Abhijit Halder
0 siblings, 0 replies; 13+ messages in thread
From: Abhijit Halder @ 2012-05-09 4:28 UTC (permalink / raw)
To: André Pönitz; +Cc: gdb-patches@sourceware.org ml
On Wed, May 9, 2012 at 3:36 AM, André Pönitz
<andre.poenitz@mathematik.tu-chemnitz.de> wrote:
> On Tue, May 08, 2012 at 11:16:11AM +0530, Abhijit Halder wrote:
>> [...] I am not completely aware of the limitation of this approach,
>> but it makes me happy thinking that the GDB users who want to extend
>> GDB functionality but are not well accustomed with GDB source code,
>> can still write their own pluggins and use an enhanced GDB without the
>> pain of recompilation of entire GDB source code.
>
> I guess I fit the bill of a "user[s] who want to extend GDB
> functionality but are not well accustomed with GDB source code"
> rather well. It's something I've been doing for quite a while now.
> However, the idea of writing plugins for GDB is not exactly
> appealing to me.
>
> For one. the "pain of recompilation of entire GDB source code" you
> mention does not exist. It's a straight-forward ./configure &&
> make, not even with enough waiting time for a successful trip to
> the coffee maker (Unless you are on Windows and need to build all
> dependencies, but that would not be different for plugins)
>
> Secondly, GDB is pretty extensible using Python scripting already,
> giving "zero compile time" and platform independent access to a lot
> of functionality. It's hard to see how compiled plugins would
> improve that situation. I'd rather expect the effort for creating
> and maintaining a plugin interface to eat into the already scarce
> resources of the developers, for really not much benefit.
>
> So, please, pretty please, can we drop the idea? ;-)
>
> Andre'
Well, I am not fully aware of Python interface. If this proposed idea
does not make much any in current GDB, I will not push this.
Thanks,
Abhijit Halder
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-05-09 4:28 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07 16:21 GDB plugin Abhijit Halder
2012-05-07 20:18 ` Tom Tromey
2012-05-08 5:46 ` Abhijit Halder
2012-05-08 14:20 ` Tom Tromey
2012-05-08 15:05 ` Joel Brobecker
2012-05-08 15:21 ` Mark Kettenis
2012-05-08 22:06 ` André Pönitz
2012-05-09 4:28 ` Abhijit Halder
2012-05-08 6:38 ` Hui Zhu
2012-05-08 13:46 ` Tom Tromey
2012-05-08 14:38 ` Matt Rice
2012-05-08 14:47 ` Paul_Koning
2012-05-08 14:58 ` Matt Rice
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox