gdb: split gdbarch component types to gdbarch_types.py
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 27 Feb 2023 01:13:59 +0000 (20:13 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 27 Feb 2023 18:28:32 +0000 (13:28 -0500)
commit05e4e893736c870ad5d2fd4e7ea8d95a94cdff3c
treebacde4558eae792fbe32fd13e4d83a37ae02ebb2
parent9f353051dee5262914ea33785896c6df3978adf7
gdb: split gdbarch component types to gdbarch_types.py

Editing gdbarch-components.py is not an experience in an editor that is
minimally smart about Python.  Because gdbarch-components.py is read and
exec'd by gdbarch.py, it doesn't import the  Info / Method / Function /
Value types.  And because these types are defined in gdbarch.py, it
can't import them, as that would make a cyclic dependency.

Solve this by introducing a third file, gdbarch_types.py, to define
these types.  Make gdbarch.py and gdbarch-components.py import it.
Also, replace the read & exec of gdbarch-components.py by a regular
import.  For this to work though, gdbarch-components.py needs to be
renamed to gdbarch_components.py.

Change-Id: Ibe994d56ef9efcc0698b3ca9670d4d9bf8bbb853
Reviewed-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
gdb/gdbarch-components.py [deleted file]
gdb/gdbarch.py
gdb/gdbarch_components.py [new file with mode: 0644]
gdb/gdbarch_types.py [new file with mode: 0755]