This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] fix mi-support.exp to have consistent test names
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Wed, 28 Aug 2013 11:07:56 -0600
- Subject: [PATCH] fix mi-support.exp to have consistent test names
- Authentication-results: sourceware.org; auth=none
The "varobj_tree" code in mi-support.exp keeps a counter to try to
ensure that test names are unique.
However, this counter is never reset, only incremented. What this
means is that the test names depend on the order of calls into this
code. This is not good if you want to run the tests independently.
This patch fixes the issue by resetting the counter on each call to
varobj_tree::walk_tree.
This change did not result in any new non-unique test names in gdb.mi.
It does change some test names, of course, so be warned about that.
* lib/mi-support.exp (varobj_tree::walk_tree): Set _root_idx
to 0.
---
gdb/testsuite/lib/mi-support.exp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 86a0fd6..3d55609 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -2259,11 +2259,14 @@ namespace eval ::varobj_tree {
# given varobj TREE. See detailed explanation above.
proc walk_tree {language tree callback} {
global root
+ variable _root_idx
if {[llength $tree] < 3} {
error "tree does not contain enough elements"
}
+ set _root_idx 0
+
# Create root node and process the tree.
array set root [list language $language]
array set root [list obj_name "root"]
--
1.8.1.4