[PATCH 7/8] Add new Python APIs to support DAP value display
Eli Zaretskii
eliz@gnu.org
Tue Aug 22 15:46:16 GMT 2023
> Date: Tue, 22 Aug 2023 09:25:13 -0600
> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
>
> gdb's language code may know how to display values specially. For
> example, the Rust code understands that &str is a string-like type, or
> Ada knows how to handle unconstrained arrays. This knowledge is
> exposed via val-print, and via varobj -- but currently not via DAP.
>
> This patch adds some support code to let DAP also handle these cases,
> though in a somewhat more generic way.
>
> Type.is_array_like and Value.to_array are added to make Python aware
> of the cases where gdb knows that a structure type is really
> "array-like".
>
> Type.is_string_like is added to make Python aware of cases where gdb's
> language code knows that a type is string-like.
>
> Unlike Value.string, these cases are handled by the type's language,
> rather than the current language.
> ---
> gdb/NEWS | 8 ++++++++
> gdb/doc/python.texi | 24 ++++++++++++++++++++++
> gdb/python/py-type.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
> gdb/python/py-value.c | 37 +++++++++++++++++++++++++++++++++
> 4 files changed, 126 insertions(+)
Thanks, the documentation parts are okay.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
More information about the Gdb-patches
mailing list