gdb_test_multiple: Fix user code argument processing
authorPedro Alves <palves@redhat.com>
Tue, 7 Apr 2015 17:19:30 +0000 (18:19 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 7 Apr 2015 17:27:24 +0000 (18:27 +0100)
While teaching gdb_test_multiple to forward "-i" to gdb_expect, I
found that with:

      gdb_test_multiple (...) {
        -i $some_variable -re "..." {}
      }

$some_variable was not getting expanded in the gdb_test_multiple
caller's scope.  This is a bug inside gdb_test_multiple.  When
processing an argument in passed in user code, it was appending the
original argument literally, instead of appending the uplist'ed
argument.

gdb/testsuite/ChangeLog:
2015-04-07  Pedro Alves  <palves@redhat.com>

        * lib/gdb.exp (gdb_test_multiple): When processing an argument,
append the substituted item, not the original item.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 82544a0de088ef8a6a55afec3c26e964ba7c76d9..694b1c80f30d28b81013d06ac92d52cc18b8b200 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-07  Pedro Alves  <palves@redhat.com>
+
+        * lib/gdb.exp (gdb_test_multiple): When processing an argument,
+       append the substituted item, not the original item.
+
 2015-04-07  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/interrupt.exp: Use gdb_test_multiple instead of
index e0a03ec395c1737731b4c96d4f41fbbbadb326e6..203b8cf0800bf00455a10c594668e1ba7ce56f48 100644 (file)
@@ -730,7 +730,7 @@ proc gdb_test_multiple { command message user_code } {
        }
        if { $expecting_arg } {
            set expecting_arg 0
-           lappend processed_code $item
+           lappend processed_code $subst_item
            continue
        }
        if { $expecting_action } {
This page took 0.034658 seconds and 4 git commands to generate.