From: Matthieu Longo <matthieu.longo@arm.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 4/6] gdb: new setters and getters for __dict__, and attributes
Date: Wed, 28 Jan 2026 17:43:17 +0000 [thread overview]
Message-ID: <9b84d0cf-bca5-4761-9c6c-1b59d9dd2d33@arm.com> (raw)
In-Reply-To: <878qdian9r.fsf@tromey.com>
On 27/01/2026 19:06, Tom Tromey wrote:
> Matthieu> -using thread_map_t
> Matthieu> - = gdb::unordered_map<thread_info *, gdbpy_ref<thread_object>>;
> Matthieu> -
> Matthieu> -struct inferior_object
> Matthieu> -{
> Matthieu> - PyObject_HEAD
>
> This moved to python-internal.h, but I don't understand why that move
> is needed.
I moved the declaration to python-internal.h because of the following build issue after adding the static_assert in gdbpy_ref_policy.
CXX python/py-exitedevent.o
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/stl_function.h:60,
from /usr/include/c++/14/functional:49,
from ../../gdb/../gdbsupport/ptid.h:35,
from ../../gdb/../gdbsupport/common-defs.h:212,
from ./../../gdb/defs.h:26,
from <command-line>:
/usr/include/c++/14/type_traits: In instantiation of ‘struct std::is_base_of<_object, inferior_object>’:
../../gdb/python/py-ref.h:29:47: required from ‘struct gdbpy_ref_policy<inferior_object>’
29 | static_assert(std::is_base_of<PyObject, T>::value,
| ^~~~~
../../gdb/python/py-exitedevent.c:42:18: required from here
42 | if (inf_obj == NULL || evpy_add_attribute (exited_event.get (),
| ^~~~
/usr/include/c++/14/type_traits:1493:30: error: invalid use of incomplete type ‘struct inferior_object’
1493 | : public __bool_constant<__is_base_of(_Base, _Derived)>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../gdb/python/py-events.h:24,
from ../../gdb/python/py-event.h:23,
from ../../gdb/python/py-exitedevent.c:20:
../../gdb/python/python-internal.h:405:8: note: forward declaration of ‘struct inferior_object’
405 | struct inferior_object;
| ^~~~~~~~~~~~~~~
In file included from ../../gdb/python/python-internal.h:61:
../../gdb/python/py-ref.h: In instantiation of ‘struct gdbpy_ref_policy<inferior_object>’:
../../gdb/python/py-exitedevent.c:42:18: required from here
42 | if (inf_obj == NULL || evpy_add_attribute (exited_event.get (),
| ^~~~
../../gdb/python/py-ref.h:29:47: error: ‘value’ is not a member of ‘std::is_base_of<_object, inferior_object>’
29 | static_assert(std::is_base_of<PyObject, T>::value,
| ^~~~~
next prev parent reply other threads:[~2026-01-28 17:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 17:02 [PATCH v2 0/6] gdb: minor fixes for Python limited C API support Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 1/6] Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString Matthieu Longo
2026-01-27 17:54 ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 2/6] Python limited API: migrate PyImport_ExtendInittab Matthieu Longo
2026-01-27 17:54 ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 3/6] gdbpy_registry: cast C extension type object to PyObject * before Py_XINCREF Matthieu Longo
2026-01-27 18:01 ` Tom Tromey
2026-01-27 18:29 ` Tom Tromey
2026-01-28 11:58 ` Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 4/6] gdb: new setters and getters for __dict__, and attributes Matthieu Longo
2026-01-27 19:06 ` Tom Tromey
2026-01-28 11:57 ` Matthieu Longo
2026-01-28 17:43 ` Matthieu Longo [this message]
2026-01-28 17:51 ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 5/6] gdb: cast all Python extension objects passed to gdbpy_ref_policy to PyObject* Matthieu Longo
2026-01-27 18:28 ` Tom Tromey
2026-01-28 11:58 ` Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 6/6] gdb: make remaining Python extension objects inherit from PyObject Matthieu Longo
2026-01-27 18:29 ` Tom Tromey
2026-01-28 11:58 ` Matthieu Longo
2026-01-28 12:02 [PATCH v2 4/6] gdb: new setters and getters for __dict__, and attributes Matthieu Longo
2026-01-28 18:00 ` Tom Tromey
2026-01-29 10:42 ` Matthieu Longo
2026-01-29 14:45 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b84d0cf-bca5-4761-9c6c-1b59d9dd2d33@arm.com \
--to=matthieu.longo@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox