Re: [PATCH 3/5] gdb/python: Add gdb.Architecture.registers method

Eli Zaretskii
2020-06-17T18:26:12Z

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Wed, 17 Jun 2020 18:38:07 +0100
> gdb/ChangeLog:
>
> * Makefile.in (SUBDIR_PYTHON_SRCS): Add py-registers.c
> * python/py-arch.c (archpy_registers): New function.
> (arch_object_methods): Add 'registers' method.
> * python/py-registers.c: New file.
> * python/python-internal.h
> (gdbpy_new_register_descriptor_iterator): Declare.
> (gdbpy_initialize_registers): Declare.
> * python/python.c (do_start_initialization): Call
> gdbpy_initialize_registers.
> * NEWS: Mention additions to the Python API.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.python/py-arch-reg-names.exp: New file.
>
> gdb/doc/ChangeLog:
>
> * python.texi (Python API): Add new section the menu.
^^^^^^^^
"to the menu".

> (Frames In Python): Add new @anchor.
> (Architectures In Python): Document new registers method.
> (Registers In Python): New section.

The documentation parts are approved, with a few nits:

> +@anchor{gdbpy_architecture_registers}
> +@defun Architecture.registers (@r{[} @var{reggroup} @r{]})
> +Return a @code{gdb.RegisterDescriptorIterator} (@pxref{Registers In
> +Python}) for all of the registers in @var{reggroup}, a string that is
> +the name of a register group. If @var{reggroup} is missing, or is the
^^^^^^^
"omitted" is better here.

> +empty string, then the register group @dfn{all} is assumed.
^^^^^^^^^
Please use @samp here instead of @dfn. The latter is for markup of
terminology, which is not what you want here.

> +A @code{gdb.RegisterDescriptor} does not provide the value of a
> +register (@pxref{gdbpy_frame_read_register,,@code{Frame.read_register}} for reading a registers
^^^^^^^^^
You meant "register's" here, with the apostrophe, right?

Thanks.