aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.guile/scm-value.exp
diff options
context:
space:
mode:
authorGeorge Barrett <bob@bob131.so>2021-04-29 03:32:47 +1000
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-05-12 12:35:36 +0100
commit9d4fc61d41a0aef2d199e2b18d238603a8e4be98 (patch)
tree6d14bbf4abcb031b467556465c1dab31060159ac /gdb/testsuite/gdb.guile/scm-value.exp
parent97cef6b7b79c22a3cc14ef369c1dc09a8bcca357 (diff)
downloadgdb-9d4fc61d41a0aef2d199e2b18d238603a8e4be98.zip
gdb-9d4fc61d41a0aef2d199e2b18d238603a8e4be98.tar.gz
gdb-9d4fc61d41a0aef2d199e2b18d238603a8e4be98.tar.bz2
Guile: add value-{rvalue-,}reference-value
The Guile API doesn't currently have an equivalent to the Python API's Value.reference_value() or Value.rvalue_reference_value(). This commit adds a procedure with equivalent semantics to the Guile API. gdb/ChangeLog: * NEWS (Guile API): Note the addition of new procedures. * guile/scm-value.c (gdbscm_reference_value): Add helper function for reference value creation. (gdbscm_value_reference_value): Add implementation of value-reference-value procedure. (gdbscm_value_rvalue_reference_value): Add implementation of value-rvalue-reference-value procedure. (value_functions): Add value-reference-value procedure. Add value-rvalue-reference-value procedure. gdb/doc/ChangeLog: * guile.texi (Values From Inferior In Guile): Add documentation for value-reference-value. Add documentation for value-rvalue-reference-value. gdb/testsuite/ChangeLog: * gdb.guile/scm-value.exp (test_value_in_inferior): Add test for value-reference-value. Add test for value-rvalue-reference-value.
Diffstat (limited to 'gdb/testsuite/gdb.guile/scm-value.exp')
-rw-r--r--gdb/testsuite/gdb.guile/scm-value.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp
index 191af1d..b3f785c 100644
--- a/gdb/testsuite/gdb.guile/scm-value.exp
+++ b/gdb/testsuite/gdb.guile/scm-value.exp
@@ -173,6 +173,16 @@ proc test_value_in_inferior {} {
"get string beyond null"
gdb_test "gu (print nullst)" \
"= divide\\\\000et"
+
+ gdb_scm_test_silent_cmd "gu (define argv-ref (value-reference-value argv))" \
+ "test value-reference-value"
+ gdb_test "gu (equal? argv (value-referenced-value argv-ref))" "#t"
+ gdb_test "gu (eqv? (type-code (value-type argv-ref)) TYPE_CODE_REF)" "#t"
+
+ gdb_scm_test_silent_cmd "gu (define argv-rref (value-rvalue-reference-value argv))" \
+ "test value-rvalue-reference-value"
+ gdb_test "gu (equal? argv (value-referenced-value argv-rref))" "#t"
+ gdb_test "gu (eqv? (type-code (value-type argv-rref)) TYPE_CODE_RVALUE_REF)" "#t"
}
proc test_strings {} {