guile: Add 'history-append!' procedure.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.guile / scm-value.exp
index 3ebdd585b3a981ed307f188e879dc5f6c16f0dbb..89f0ff1d610e3e3cf04e08abf8d7759af7c8c31e 100644 (file)
@@ -59,6 +59,14 @@ proc test_value_in_inferior {} {
     gdb_test "gu (print (value-field s \"a\"))" \
        "= 3" "access element inside struct using string name"
 
+    # Append value in the value history.
+    gdb_scm_test_silent_cmd "gu (define i (history-append! (make-value 42)))" \
+       "append 42"
+
+    gdb_test "gu i" "\[0-9\]+"
+    gdb_test "gu (history-ref i)" "#<gdb:value 42>"
+    gdb_test "p \$" "= 42"
+
     # Test dereferencing the argv pointer.
 
     # Just get inferior variable argv the value history, available to guile.
This page took 0.025231 seconds and 4 git commands to generate.