Index: gdb/testsuite/gdb.mi/mi-var-invalidate.exp |
diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp |
index 3ecbbdf67d818f18b3b6e33ba2e09de24e6ca822..3a61624ba82c262e7c1129e783cb2a9d20f2966d 100644 |
--- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp |
+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2007-2012 Free Software Foundation, Inc. |
+# Copyright 2007-2013 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -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\"\}\\\]" \ |