* [python][patch] Info about base class in gdb.Type
@ 2009-06-18 13:50 Richard Ward
2009-11-02 13:59 ` Phil Muldoon
0 siblings, 1 reply; 7+ messages in thread
From: Richard Ward @ 2009-06-18 13:50 UTC (permalink / raw)
To: Project Archer
[-- Attachment #1: Type: text/plain, Size: 650 bytes --]
A small patch to add a bool indicating if a class member as returned by
the fields method on a gdb.Type represents a base class.
PS. asked about this (and other patches I'll hopefully be sending) on
IRC and was told to sign the copyright waiver thing for the FSF before
submitting. Not sure if I need to give any info on that but the FSF say
they have it now.
2009-05-28 Richard Ward <richard.j.ward1@googlemail.com>
* gdb/python/python-type.c
convert_field adds a new bool entry "base_class" indicating
whether the field represents a base class
* gdb/doc/gdb.texinfo:
updated to refelect the above.
[-- Attachment #2: pythonbaseclass.patch --]
[-- Type: text/x-patch, Size: 1936 bytes --]
From c9357da0d5970bd54af4a707c6253b9b65d51bb5 Mon Sep 17 00:00:00 2001
From: Richard Ward <richard@elemental-lin.(none)>
Date: Fri, 29 May 2009 13:00:12 +0100
Subject: [PATCH] 2009-05-28 Richard Ward <richard.j.ward1@googlemail.com>
* gdb/python/python-type.c
convert_field adds a new bool entry "base_class" indicating
whether the field represents a base class
* gdb/doc/gdb.texinfo: updated to refelect this.
---
gdb/doc/gdb.texinfo | 6 ++++++
gdb/python/python-type.c | 5 +++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 958a74f..82944c4 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18516,6 +18516,12 @@ This is @code{True} if the field is artificial, usually meaning that
it was provided by the compiler and not the user. This attribute is
always provided, and is @code{False} if the field is not artificial.
+@item base_class
+This is @code{True} if the field represents a base class of a C@t{++}
+structure. This attribute is always provided, and is @code{False}
+if the field is not a base class of the type on which @code{fields} was
+called, or if that type was not a C@t{++} class.
+
@item bitsize
If the field is packed, or is a bitfield, then this will have a
non-zero value, which is the size of the field in bits. Otherwise,
diff --git a/gdb/python/python-type.c b/gdb/python/python-type.c
index 53a7eab..d9d6120 100644
--- a/gdb/python/python-type.c
+++ b/gdb/python/python-type.c
@@ -168,6 +168,11 @@ convert_field (struct type *type, int field)
if (PyObject_SetAttrString (result, "artificial", arg) < 0)
goto failarg;
+ arg = field < TYPE_N_BASECLASSES (type) ? Py_True : Py_False;
+ Py_INCREF (arg);
+ if (PyObject_SetAttrString (result, "base_class", arg) < 0)
+ goto failarg;
+
arg = PyLong_FromLong (TYPE_FIELD_BITSIZE (type, field));
if (!arg)
goto fail;
--
1.6.0.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-06-18 13:50 [python][patch] Info about base class in gdb.Type Richard Ward
@ 2009-11-02 13:59 ` Phil Muldoon
2009-11-02 15:10 ` Phil Muldoon
0 siblings, 1 reply; 7+ messages in thread
From: Phil Muldoon @ 2009-11-02 13:59 UTC (permalink / raw)
To: richard.j.ward1; +Cc: Project Archer
On 06/18/2009 02:50 PM, Richard Ward wrote:
> A small patch to add a bool indicating if a class member as returned by
> the fields method on a gdb.Type represents a base class.
>
> PS. asked about this (and other patches I'll hopefully be sending) on
> IRC and was told to sign the copyright waiver thing for the FSF before
> submitting. Not sure if I need to give any info on that but the FSF say
> they have it now.
>
> 2009-05-28 Richard Ward<richard.j.ward1@googlemail.com>
>
> * gdb/python/python-type.c
> convert_field adds a new bool entry "base_class" indicating
> whether the field represents a base class
> * gdb/doc/gdb.texinfo:
> updated to refelect the above.
>
Richard,
I have a patch ready for upstream that depends on your patch. As you
have papers on file, can you submit this to FSF GDB upstream at
gdb-patches@sourceware.org?
If I can help in this, let me know and I'll help however I can.
Cheers,
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-11-02 13:59 ` Phil Muldoon
@ 2009-11-02 15:10 ` Phil Muldoon
2009-11-02 19:50 ` Richard Ward
0 siblings, 1 reply; 7+ messages in thread
From: Phil Muldoon @ 2009-11-02 15:10 UTC (permalink / raw)
To: richard.j.ward1; +Cc: Project Archer
On 11/02/2009 01:59 PM, Phil Muldoon wrote:
> On 06/18/2009 02:50 PM, Richard Ward wrote:
>> A small patch to add a bool indicating if a class member as returned by
>> the fields method on a gdb.Type represents a base class.
>>
>> PS. asked about this (and other patches I'll hopefully be sending) on
>> IRC and was told to sign the copyright waiver thing for the FSF before
>> submitting. Not sure if I need to give any info on that but the FSF say
>> they have it now.
>>
>> 2009-05-28 Richard Ward<richard.j.ward1@googlemail.com>
>>
>> * gdb/python/python-type.c
>> convert_field adds a new bool entry "base_class" indicating
>> whether the field represents a base class
>> * gdb/doc/gdb.texinfo:
>> updated to refelect the above.
>
> Richard,
>
> I have a patch ready for upstream that depends on your patch. As you
> have papers on file, can you submit this to FSF GDB upstream at
> gdb-patches@sourceware.org?
>
Oops part of my patch fixes a buglet in your is_base_class patch; the
other section adds the beginnings of a testsuite for Python types. I
can just merge the patches, ChangeLogs and submit it all upstream as one
patch. What do you think?
Regards
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-11-02 15:10 ` Phil Muldoon
@ 2009-11-02 19:50 ` Richard Ward
2009-11-02 20:42 ` Phil Muldoon
2009-12-03 21:23 ` Phil Muldoon
0 siblings, 2 replies; 7+ messages in thread
From: Richard Ward @ 2009-11-02 19:50 UTC (permalink / raw)
To: Phil Muldoon; +Cc: Project Archer
On Mon, 2009-11-02 at 15:09 +0000, Phil Muldoon wrote:
> On 11/02/2009 01:59 PM, Phil Muldoon wrote:
> > On 06/18/2009 02:50 PM, Richard Ward wrote:
> >> A small patch to add a bool indicating if a class member as returned by
> >> the fields method on a gdb.Type represents a base class.
> >>
> >> PS. asked about this (and other patches I'll hopefully be sending) on
> >> IRC and was told to sign the copyright waiver thing for the FSF before
> >> submitting. Not sure if I need to give any info on that but the FSF say
> >> they have it now.
> >>
> >> 2009-05-28 Richard Ward<richard.j.ward1@googlemail.com>
> >>
> >> * gdb/python/python-type.c
> >> convert_field adds a new bool entry "base_class" indicating
> >> whether the field represents a base class
> >> * gdb/doc/gdb.texinfo:
> >> updated to refelect the above.
> >
> > Richard,
> >
> > I have a patch ready for upstream that depends on your patch. As you
> > have papers on file, can you submit this to FSF GDB upstream at
> > gdb-patches@sourceware.org?
> >
>
>
> Oops part of my patch fixes a buglet in your is_base_class patch; the
> other section adds the beginnings of a testsuite for Python types. I
> can just merge the patches, ChangeLogs and submit it all upstream as one
> patch. What do you think?
>
> Regards
>
> Phil
Sounds fine to me.
The only thing is I was rather hoping that my email would appear in
either the ChangeLogs or the version control logs (I'm looking for work
at the moment, and if I say in my CV or an interview that I submitted
some small patches to gdb I'd like to be able to prove it). Will that be
the case? If not then its not the end of the world.
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-11-02 19:50 ` Richard Ward
@ 2009-11-02 20:42 ` Phil Muldoon
2009-12-03 21:23 ` Phil Muldoon
1 sibling, 0 replies; 7+ messages in thread
From: Phil Muldoon @ 2009-11-02 20:42 UTC (permalink / raw)
To: richard.j.ward1; +Cc: Project Archer
On 11/02/2009 07:50 PM, Richard Ward wrote:
> On Mon, 2009-11-02 at 15:09 +0000, Phil Muldoon wrote:
>
>> On 11/02/2009 01:59 PM, Phil Muldoon wrote:
>>
>>> On 06/18/2009 02:50 PM, Richard Ward wrote:
>>>
>>>> A small patch to add a bool indicating if a class member as returned by
>>>> the fields method on a gdb.Type represents a base class.
>>>>
>>>> PS. asked about this (and other patches I'll hopefully be sending) on
>>>> IRC and was told to sign the copyright waiver thing for the FSF before
>>>> submitting. Not sure if I need to give any info on that but the FSF say
>>>> they have it now.
>>>>
>>>> 2009-05-28 Richard Ward<richard.j.ward1@googlemail.com>
>>>>
>>>> * gdb/python/python-type.c
>>>> convert_field adds a new bool entry "base_class" indicating
>>>> whether the field represents a base class
>>>> * gdb/doc/gdb.texinfo:
>>>> updated to refelect the above.
>>>>
>>> Richard,
>>>
>>> I have a patch ready for upstream that depends on your patch. As you
>>> have papers on file, can you submit this to FSF GDB upstream at
>>> gdb-patches@sourceware.org?
>>>
>>>
>>
>> Oops part of my patch fixes a buglet in your is_base_class patch; the
>> other section adds the beginnings of a testsuite for Python types. I
>> can just merge the patches, ChangeLogs and submit it all upstream as one
>> patch. What do you think?
>>
>> Regards
>>
>> Phil
>>
> Sounds fine to me.
>
> The only thing is I was rather hoping that my email would appear in
> either the ChangeLogs or the version control logs (I'm looking for work
> at the moment, and if I say in my CV or an interview that I submitted
> some small patches to gdb I'd like to be able to prove it). Will that be
> the case? If not then its not the end of the world
That would definitely be the case (with ChangeLogs). The patches to
gdb-patches would include an entry with your name on the ChangeLog but
the patch to gdb-cvs (http://sourceware.org/ml/gdb-cvs) would show up
under my commit. However, if you want to combine the two patches and
submit it, that would be totally fine for me too. It would help in
building a case to MAINTAINERS addition/write-after-commit in FSF GDB
for your own case. And another GDB commiter is always a good thing.
I'm totally understand the situation, and will help in anyway way I can.
Do you want to do the combining, patch-review, committing to FSF
upstream? I'm totally fine with it.
Regards
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-11-02 19:50 ` Richard Ward
2009-11-02 20:42 ` Phil Muldoon
@ 2009-12-03 21:23 ` Phil Muldoon
2009-12-04 3:53 ` Richard Ward
1 sibling, 1 reply; 7+ messages in thread
From: Phil Muldoon @ 2009-12-03 21:23 UTC (permalink / raw)
To: richard.j.ward1; +Cc: Project Archer
>> On 11/02/2009 01:59 PM, Phil Muldoon wrote:
>> Oops part of my patch fixes a buglet in your is_base_class patch; the
>> other section adds the beginnings of a testsuite for Python types. I
>> can just merge the patches, ChangeLogs and submit it all upstream as one
>> patch. What do you think?
>
> On 11/02/2009 07:50 PM, Richard Ward wrote:
>
> Sounds fine to me.
>
> The only thing is I was rather hoping that my email would appear in
> either the ChangeLogs or the version control logs (I'm looking for work
> at the moment, and if I say in my CV or an interview that I submitted
> some small patches to gdb I'd like to be able to prove it). Will that be
> the case? If not then its not the end of the world.
I went ahead and committed this today to FSF upstream:
http://sourceware.org/ml/gdb-cvs/2009-12/msg00018.html
Cheers,
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [python][patch] Info about base class in gdb.Type
2009-12-03 21:23 ` Phil Muldoon
@ 2009-12-04 3:53 ` Richard Ward
0 siblings, 0 replies; 7+ messages in thread
From: Richard Ward @ 2009-12-04 3:53 UTC (permalink / raw)
To: Phil Muldoon; +Cc: Project Archer
Phil Muldoon wrote:
>>> On 11/02/2009 01:59 PM, Phil Muldoon wrote:
>>> Oops part of my patch fixes a buglet in your is_base_class patch; the
>>> other section adds the beginnings of a testsuite for Python types. I
>>> can just merge the patches, ChangeLogs and submit it all upstream as one
>>> patch. What do you think?
>> On 11/02/2009 07:50 PM, Richard Ward wrote:
>>
>> Sounds fine to me.
>>
>> The only thing is I was rather hoping that my email would appear in
>> either the ChangeLogs or the version control logs (I'm looking for work
>> at the moment, and if I say in my CV or an interview that I submitted
>> some small patches to gdb I'd like to be able to prove it). Will that be
>> the case? If not then its not the end of the world.
>
> I went ahead and committed this today to FSF upstream:
>
> http://sourceware.org/ml/gdb-cvs/2009-12/msg00018.html
>
> Cheers,
>
> Phil
Thanks, glad to know it made it somewhere useful.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-04 3:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-18 13:50 [python][patch] Info about base class in gdb.Type Richard Ward
2009-11-02 13:59 ` Phil Muldoon
2009-11-02 15:10 ` Phil Muldoon
2009-11-02 19:50 ` Richard Ward
2009-11-02 20:42 ` Phil Muldoon
2009-12-03 21:23 ` Phil Muldoon
2009-12-04 3:53 ` Richard Ward
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).