Allow re-assigning to convenience variables
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / gdbvars.exp
index 8259115b7fb2780d157821b386863932b7a6ab45..a4e5b417ac50f394c08d984884829f92b4654e03 100644 (file)
@@ -51,6 +51,21 @@ proc test_convenience_variables {} {
 
     gdb_test "print \$bar"             " = void" \
        "Print contents of uninitialized convenience variable"
+
+
+    gdb_test "print \$str = \"some string\"" \
+       " = \"some string\"" \
+       "Set convenience variable to string value"
+    gdb_test "print \$str = \"some other string\"" \
+       " = \"some other string\"" \
+       "Change convenience variable to different string value"
+
+    gdb_test "print \$arr = {1, 2, 3}" \
+       " = \\{1, 2, 3\\}" \
+       "Set convenience variable to array value"
+    gdb_test "print \$arr = {0, 1, 2, 3}" \
+       " = \\{0, 1, 2, 3\\}" \
+       "Set convenience variable to different array value"
 }
 
 proc test_convenience_functions {} {
This page took 0.025779 seconds and 4 git commands to generate.