[PATCH 6/9] gdb: add asserts to gdbarch_register_name

Tom Tromey tom@tromey.com
Wed Sep 21 18:04:28 GMT 2022


>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
Andrew> index 696b3028e6f..699ed4f69d2 100755
Andrew> --- a/gdb/gdbarch.py
Andrew> +++ b/gdb/gdbarch.py
Andrew> @@ -112,6 +112,8 @@ class Function(_Component):
Andrew>          postdefault=None,
Andrew>          invalid=None,
Andrew>          printer=None,
Andrew> +        param_checks=None,
Andrew> +        result_checks=None,
Andrew>      ):
Andrew>          super().__init__(
Andrew>              comment=comment,
Andrew> @@ -124,6 +126,11 @@ class Function(_Component):
Andrew>              printer=printer,
Andrew>              params=params,
Andrew>          )
Andrew> +        self.param_checks = param_checks
Andrew> +        self.result_checks = result_checks

It's fine to just pass these to the superclass constructor.
That will ensure they end up as attributes of 'self', without needing
separate assignments.

Tom


More information about the Gdb-patches mailing list