[00/14] Add a type-safe API to registries

Message ID 20190423020955.17356-1-tom@tromey.com
Headers show
Series
  • Add a type-safe API to registries
Related show

Message

Tom Tromey April 23, 2019, 2:09 a.m.
This series adds an optional type-safe API to the gdb registry
feature, and converts various modules to use it.

I don't think this is the final form for registries -- in the long run
I suppose I'd like to turn them into a CRTP mixin class.  However,
this series seems like a reasonable step along the way, providing type
safety and using policy classes for destruction.

Let me know what you think.

Regression tested by the buildbot.

Tom

Comments

John Baldwin April 23, 2019, 11:11 p.m. | #1
On 4/22/19 7:09 PM, Tom Tromey wrote:
> This series adds an optional type-safe API to the gdb registry

> feature, and converts various modules to use it.

> 

> I don't think this is the final form for registries -- in the long run

> I suppose I'd like to turn them into a CRTP mixin class.  However,

> this series seems like a reasonable step along the way, providing type

> safety and using policy classes for destruction.

> 

> Let me know what you think.

> 

> Regression tested by the buildbot.


I looked a few of these over and think it's an improvement.  Do existing
keys still work btw?  I know fbsd-tdep.c has a progspace key to cache
info needed to resolve TLS variables.  It also has gdbarch data used to
cache the generated type for $_siginfo.  I don't mind converting them
myself if the changes support both the old and new styles for now.

-- 
John Baldwin
Tom Tromey April 24, 2019, 12:57 a.m. | #2
>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:


John> I looked a few of these over and think it's an improvement.  Do existing
John> keys still work btw?  I know fbsd-tdep.c has a progspace key to cache
John> info needed to resolve TLS variables.  It also has gdbarch data used to
John> cache the generated type for $_siginfo.  I don't mind converting them
John> myself if the changes support both the old and new styles for now.

Yes, this is implemented by adding a new type-safe wrapper for the
existing functions.  I think it would be good to convert everything but
I haven't done so yet.

Tom
Pedro Alves June 18, 2019, 1:41 p.m. | #3
On 4/23/19 3:09 AM, Tom Tromey wrote:
> This series adds an optional type-safe API to the gdb registry

> feature, and converts various modules to use it.

> 

> I don't think this is the final form for registries -- in the long run

> I suppose I'd like to turn them into a CRTP mixin class.  However,

> this series seems like a reasonable step along the way, providing type

> safety and using policy classes for destruction.

> 

> Let me know what you think.


I only managed to read this now, but I'd still like to say thanks
for doing this.

Thanks,
Pedro Alves