aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.guile
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-03-13 09:24:19 -0700
committerDoug Evans <xdje42@gmail.com>2014-03-13 09:24:19 -0700
commit350e1a768cca6deab7aeca8adcff9561faeb1f35 (patch)
tree0516a81e3241b782e18e12a726da4054c1b7d2f2 /gdb/testsuite/gdb.guile
parentc307e84195f4cc97bf73fcefcb947f73a17b1141 (diff)
downloadgdb-350e1a768cca6deab7aeca8adcff9561faeb1f35.zip
gdb-350e1a768cca6deab7aeca8adcff9561faeb1f35.tar.gz
gdb-350e1a768cca6deab7aeca8adcff9561faeb1f35.tar.bz2
Fix segv when referencing a value added to history after a Guile garbage collect.
* value.c (record_latest_value): Call release_value_or_incref instead of release_value. testsuite/ * gdb.guile/scm-value.exp (test_value_in_inferior): Verify value added to history survives a gc.
Diffstat (limited to 'gdb/testsuite/gdb.guile')
-rw-r--r--gdb/testsuite/gdb.guile/scm-value.exp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp
index 89f0ff1..a85d5bd 100644
--- a/gdb/testsuite/gdb.guile/scm-value.exp
+++ b/gdb/testsuite/gdb.guile/scm-value.exp
@@ -67,6 +67,10 @@ proc test_value_in_inferior {} {
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.