Re: [PATCH v2] Add gdb.Value.format_string ()

Eli Zaretskii
2019-03-18T17:49:12Z

> From: Marco Barisione <mbarisione@undo.io>
> Date: Mon, 18 Mar 2019 09:22:36 +0000
> Cc: Kevin Buettner <kevinb@redhat.com>
>
> gdb/doc/ChangeLog:
>
> 2019-03-18 Marco Barisione <mbarisione@undo.io>
>
> * python.texi: Document gdb.Value.format_string ().

Please state the node name where you made the changes, as if it were a
function (i.e. in parentheses).

> diff --git a/gdb/NEWS b/gdb/NEWS
> index c45b313406..e4d9ae0fea 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -231,6 +231,12 @@ before Windows XP.
> ** The gdb.Value type has a new constructor, which is used to construct a
> gdb.Value from a Python buffer object and a gdb.Type.
>
> + ** The gdb.Value type has a new method 'format_string' which returns a
> + string representing the value. The formatting is controlled by the
> + optional keyword arguments: 'raw', 'pretty_arrays', 'pretty_structs',
> + 'array_indexes', 'symbols', 'unions', 'deref_refs', 'actual_objects',
> + 'static_members', 'max_elements', 'repeat_threshold', and 'format'.
> +

This part is OK.

> +@code{True} if C++ references should be resolved to the value they refer
^^^
I believe we prefer to use C@t{++}, as it looks better in print.

> +to, @code{False} (the default) if they shouldn't. Note that, unlike for
> +the @code{print} command, references are not automatically expanded when
> +using the @code{format_string ()} method or the @code{str ()} function.

Please don't use "foo ()" to indicate that 'foo' is a function: the
result looks like a call to 'foo' with no arguments, which is not what
you mean Just @code{format_string} is enough, and likewise for 'str'.

> +representation of a C++ object, @code{False} if they shouldn't (see
^^^
C@t{++}

OK with those nits fixed.

Thanks.