+2014-03-13 Doug Evans <xdje42@gmail.com>
+
+ * value.c (record_latest_value): Call release_value_or_incref
+ instead of release_value.
+
2014-03-13 Pedro Alves <palves@redhat.com>
* procfs.c (procfs_target): Don't override to_shortname,
+2014-03-13 Ludovic Courtès <ludo@gnu.org>
+ Doug Evans <xdje42@gmail.com>
+
+ * gdb.guile/scm-value.exp (test_value_in_inferior): Verify value added
+ to history survives a gc.
+
2014-03-13 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp: Don't test "target procfs".
gdb_test "gu (history-ref i)" "#<gdb:value 42>"
gdb_test "p \$" "= 42"
+ # Verify the recorded history value survives a gc.
+ gdb_test_no_output "guile (gc)"
+ gdb_test "p \$\$" "= 42"
+
# Test dereferencing the argv pointer.
# Just get inferior variable argv the value history, available to guile.
from. This is a bit dubious, because then *&$1 does not just return $1
but the current contents of that location. c'est la vie... */
val->modifiable = 0;
- release_value (val);
+
+ /* The value may have already been released, in which case we're adding a
+ new reference for its entry in the history. That is why we call
+ release_value_or_incref here instead of release_value. */
+ release_value_or_incref (val);
/* Here we treat value_history_count as origin-zero
and applying to the value being stored now. */