[PATCH v2 2/9] Define and export Guile classes for all GDB object types

Andy Wingo wingo@igalia.com
Tue Feb 10 14:41:00 GMT 2015


Hi Doug,

Thanks for looking at these patches!  I just looked through my stack and
there were only a couple that you had questions on and that were still
relevant, and this was one of them.  A refreshed patch follows.

On Tue 27 May 2014 09:35, Doug Evans <xdje42@gmail.com> writes:

> Doug Evans <xdje42@gmail.com> writes:
>
>> Andy Wingo <wingo@igalia.com> writes:
>>
>>> gdb/ChangeLog:
>>> 	* guile/scm-gsmob.c (gdbscm_make_smob_type): Define a binding
>>> 	for a GOOPS class corresponding to the SMOB type.
>>> 	(gdbscm_initialize_smobs): Load GOOPS.
>>>
>>> 	* guile/lib/gdb.scm: Export the GOOPS classes.
>>
>> No blank line between related changelog entries.

Fixed.

>> Question: Is it possible to define the goops classes at some
>> random future point [e.g., long after gdb has initialized]?
>> Some might prefer not bringing goops into the picture unless
>> explicitly requested.

We could defer GOOPS class creation, yes; what happens is that when
GOOPS is loaded, that corresponding classes are created for all known
SMOB types, and that new SMOB types will create classes as they are
defined.

But it seems a bit needless to put it off, to me -- the startup penalty
is very low (just measured it to be about 12ms on a warm cache, on 2.2
at least), and it gives a uniform way to work with gsmob values, and the
type predicate, accessors, and class get to be in the same place, etc.
Dunno, wdyt?  Let me know if you want me to rework it in some way.

Cheers,

Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Define-and-export-Guile-classes-for-all-GDB-object-t.patch
Type: text/x-diff
Size: 6831 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150210/c9d1dc10/attachment.bin>


More information about the Gdb-patches mailing list