From 97cef6b7b79c22a3cc14ef369c1dc09a8bcca357 Mon Sep 17 00:00:00 2001 From: George Barrett Date: Thu, 29 Apr 2021 03:32:37 +1000 Subject: [PATCH] Guile: improved rvalue reference support Adds a couple of missing bits to the Guile API to make C++11 rvalue reference values and types usable from Guile scripts. gdb/ChangeLog: * guile/scm-type.c (type_integer_constants): Add binding for TYPE_CODE_RVALUE_REF. * guile/scm-value.c (gdbscm_value_referenced_value): Handle dereferencing of rvalue references. * NEWS (Guile API): Note improvements in rvalue reference support. gdb/doc/ChangeLog: * guile.texi (Types In Guile): Add documentation for TYPE_CODE_RVALUE_REF. --- gdb/ChangeLog | 8 ++++++++ gdb/NEWS | 7 +++++++ gdb/doc/ChangeLog | 5 +++++ gdb/doc/guile.texi | 3 +++ gdb/guile/scm-type.c | 1 + gdb/guile/scm-value.c | 1 + 6 files changed, 25 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2423d47c192..26751d318b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2021-05-12 George Barrett + + * guile/scm-type.c (type_integer_constants): Add binding for + TYPE_CODE_RVALUE_REF. + * guile/scm-value.c (gdbscm_value_referenced_value): Handle + dereferencing of rvalue references. + * NEWS (Guile API): Note improvements in rvalue reference support. + 2021-05-12 Markus Metzger * btrace.c (handle_pt_insn_events): Ignore status update enable diff --git a/gdb/NEWS b/gdb/NEWS index 784c1038920..250f79153ca 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -200,6 +200,13 @@ QMemTags Request the remote to store the specified allocation tags to the requested memory range. +* Guile API + + ** Improved support for rvalue reference values: + TYPE_CODE_RVALUE_REF is now exported as part of the API and the + value-referenced-value procedure now handles rvalue reference + values. + *** Changes in GDB 10 * There are new feature names for ARC targets: "org.gnu.gdb.arc.core" diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a7714e7c326..0546f650b32 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2021-05-12 George Barrett + + * guile.texi (Types In Guile): Add documentation for + TYPE_CODE_RVALUE_REF. + 2021-05-10 Andrew Burgess * guile.texinfo (Breakpoints In Guile): Reword sentence. diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi index 6c613797f22..c3e134b5ffe 100644 --- a/gdb/doc/guile.texi +++ b/gdb/doc/guile.texi @@ -1268,6 +1268,9 @@ A pointer-to-member. @item TYPE_CODE_REF A reference type. +@item TYPE_CODE_RVALUE_REF +A C@t{++}11 rvalue reference type. + @item TYPE_CODE_CHAR A character type. diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c index 8d9c2c5f9a4..d65102b01c7 100644 --- a/gdb/guile/scm-type.c +++ b/gdb/guile/scm-type.c @@ -1318,6 +1318,7 @@ static const scheme_integer_constant type_integer_constants[] = X (TYPE_CODE_METHODPTR), X (TYPE_CODE_MEMBERPTR), X (TYPE_CODE_REF), + X (TYPE_CODE_RVALUE_REF), X (TYPE_CODE_CHAR), X (TYPE_CODE_BOOL), X (TYPE_CODE_COMPLEX), diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c index 59995169cd0..f50e8b5b46c 100644 --- a/gdb/guile/scm-value.c +++ b/gdb/guile/scm-value.c @@ -476,6 +476,7 @@ gdbscm_value_referenced_value (SCM self) res_val = value_ind (value); break; case TYPE_CODE_REF: + case TYPE_CODE_RVALUE_REF: res_val = coerce_ref (value); break; default: -- 2.30.2