Re: [PATCH v2 9/9] gdb/python: add accessor helpers for __dict__ in Python extension objects

Tom Tromey
2026-03-06T16:05:03Z

>>>>> Matthieu Longo <matthieu.longo@arm.com> writes:

> For gdbpy_dict_wrapper_PyGetSetDef, I tried to use a constexpr function at first, but there is an issue.
> I am not aware of an easy way to concatenate strings with a constexpr in C++17.

Ahh, I missed that part, sorry about that.

> Please let me know if you know a way of making it compatible with C++17.

Maybe it's possible but I wouldn't jump through too many hoops.

> If the code is convertible to C++17, configure_dict_getter seems a good name.
> Otherwise, gdbpy_dict_wrapper_configure_dict_getter ?

> Regarding gdbpy_dict_wrapper_PyTypeObject_tps, what about gdbpy_dict_wrapper_getsetattro ?

These sound reasonable enough to me, thanks.

Tom