aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2012-07-30 12:10:23 +0000
committerAndrew Burgess <aburgess@broadcom.com>2012-07-30 12:10:23 +0000
commit4e969b4f01286290f5d06e41dd8e8a2c738d7650 (patch)
tree32109ff24285ce772a7c45c07f23254981ddd93d /gdb/testsuite/gdb.mi/mi-var-invalidate.exp
parenta6dc81d2ab37bd09527e0a00d82c4670f22a1a27 (diff)
downloadfsf-binutils-gdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.zip
fsf-binutils-gdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.tar.gz
fsf-binutils-gdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.tar.bz2
http://sourceware.org/ml/gdb-patches/2012-07/msg00551.html
Re-evaluate floating variables as part of variable invalidate to remove references to type structures that might have been freed.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-invalidate.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-invalidate.exp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
index 3ecbbdf..1f16f88 100644
--- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
@@ -61,6 +61,9 @@ mi_runto do_locals_tests
# Desc: create local variables
mi_create_varobj linteger linteger "create local variable linteger"
+# Desc: create floating variable
+mi_create_floating_varobj float_simple array "create floating variable"
+
#
# Reload the same binary.
# Global variable should remain, local should be invalidated.
@@ -69,6 +72,12 @@ mi_delete_breakpoints
mi_gdb_load ${binfile_bis}
mi_runto main
+# Change format of floating variable immediately after reload reveals a
+# bug where gdb still uses a free'd pointer.
+mi_gdb_test "-var-set-format float_simple hexadecimal" \
+ "\\^done,format=\"hexadecimal\",value=\"\\\[-1\\\]\"" \
+ "set format variable float_simple"
+
# Check local variable is "invalid".
mi_gdb_test "-var-update linteger" \
"\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \