summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hunt <hunt@redhat.com>2003-02-28 00:11:17 +0000
committerMartin Hunt <hunt@redhat.com>2003-02-28 00:11:17 +0000
commitf69f2c0540e7ee9624310c942527bd570f9a6498 (patch)
tree6ae72e804ff51b654db1f14e8d76b76066682864
parenteee476cd7542246fabf03a43e2ffb440457201e1 (diff)
downloadgdb-f69f2c0540e7ee9624310c942527bd570f9a6498.tar.gz
2003-02-27 Martin M. Hunt <hunt@redhat.com>
* cpp_variable.test: Major changes required because varobj_update now returns "-1" if a variable is out of scope.
-rw-r--r--gdb/testsuite/gdb.gdbtk/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.gdbtk/c_variable.test7
-rw-r--r--gdb/testsuite/gdb.gdbtk/cpp_variable.test30
3 files changed, 27 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.gdbtk/ChangeLog b/gdb/testsuite/gdb.gdbtk/ChangeLog
index 103f73070d0..5a1ae2d9d03 100644
--- a/gdb/testsuite/gdb.gdbtk/ChangeLog
+++ b/gdb/testsuite/gdb.gdbtk/ChangeLog
@@ -1,9 +1,12 @@
2003-02-27 Martin M. Hunt <hunt@redhat.com>
+ * cpp_variable.test: Major changes required because varobj_update
+ now returns "-1" if a variable is out of scope.
+
* c_variable.test: Major changes required because varobj_update
now returns "-1" if a variable is out of scope. This fixes a bunch
- of XFAILS.
-
+ of XFAILS. Change bug reporting address.
+
* windows.test: Remove HtmlViewer from list of windows.
* srcwin.test: Use "list get" instead of "listget" to
diff --git a/gdb/testsuite/gdb.gdbtk/c_variable.test b/gdb/testsuite/gdb.gdbtk/c_variable.test
index bae8b91914f..19dde884fe7 100644
--- a/gdb/testsuite/gdb.gdbtk/c_variable.test
+++ b/gdb/testsuite/gdb.gdbtk/c_variable.test
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# insight@sources.redhat.com
# This file was written by Keith Seitz (keiths@cygnus.com)
@@ -37,7 +37,6 @@ if {[catch {gdbtk_test_file $program} t]} {
# The variables that are created are stored in an array called "var".
# proc to tell us which of the variables are changed/out of scope
-# FIXME: ALWAYS returning out={}
proc check_update {} {
global var
@@ -51,7 +50,6 @@ proc check_update {} {
lappend changed $ret
}
}
-
return [list $changed $out]
}
@@ -2068,3 +2066,6 @@ gdbtk_test c_variable-7.81 {create variables in different scopes} {
# Exit
#
gdbtk_test_done
+
+#Local Variables:
+#mode: tcl
diff --git a/gdb/testsuite/gdb.gdbtk/cpp_variable.test b/gdb/testsuite/gdb.gdbtk/cpp_variable.test
index 9f2af787173..d2de6f3deea 100644
--- a/gdb/testsuite/gdb.gdbtk/cpp_variable.test
+++ b/gdb/testsuite/gdb.gdbtk/cpp_variable.test
@@ -1,4 +1,5 @@
-# Copyright (C) 1998 Cygnus Solutions
+# Varobj Tests (C++ language)
+# Copyright (C) 1998, 2003 Red Hat, 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
@@ -15,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# insight@sources.redhat.com
# This file was written by Keith Seitz (keiths@cygnus.com)
@@ -36,19 +37,23 @@ if {[catch {gdbtk_test_file $program} t]} {
# The variables that are created are stored in an array called "var".
# proc to tell us which of the variables are changed/out of scope
-# FIXME: ALWAYS returning out={}!
proc check_update {} {
global var
set out {}
set changed {}
foreach ind [array names var] {
- set changed [concat $changed [$var($ind) update]]
+ set ret [$var($ind) update]
+ if {$ret == -1} {
+ lappend out $ind
+ } elseif {$ret != ""} {
+ lappend changed $ret
+ }
}
-
return [list $changed $out]
}
+
# proc to create a variable
proc create_variable {expr} {
global var
@@ -204,10 +209,9 @@ gdbtk_test cpp_variable-1.6a {step over "V *v = new V;"} {
# Desc: check value of v changed
gdbtk_test cpp_variable-1.7 {check value of v changed} {
set changes [check_update]
-
# It is undefined whether the children will change values
# or not, so ignore them.
- expr {[lsearch [lindex $changes 0] v] != -1}
+ expr {[lsearch [lindex [lindex $changes 0] 0] v] != -1}
} {1}
# Test: cpp_variable-1.8
@@ -256,7 +260,7 @@ gdbtk_test cpp_variable-2.2a {set variable v.v_pub_int=2112} {
# Desc: value of v.v_pub_int changed
gdbtk_test cpp_variable-2.3 {value of v.v_pub_int changed} {
check_update
-} {v.public.v_pub_int {}}
+} {v.public.v_pub_int {v.private.v_priv_charp v.VB v.private.v_priv_int v.VC v.public.v_pub_charp v.public.v_pub_int v.private v.public v.VA}}
# Test: cpp_variable-2.4
# Desc: value of v.v_pub_int
@@ -336,7 +340,7 @@ gdbtk_test cpp_variable-2.22a {set variable v->v_priv_charp=2112} {
# Desc: value of v.v_priv_charp changed
gdbtk_test cpp_variable-2.23 {value of v.v_priv_charp changed} {
check_update
-} {v.private.v_priv_charp {}}
+} {{{v.public.v_pub_int v.private.v_priv_charp}} {v.private.v_priv_charp v.VB v.private.v_priv_int v.VC v.public.v_pub_charp v.public.v_pub_int v.private v.public v.VA}}
# Test: cpp_variable-2.24
# Desc: value of v.v_priv_charp
@@ -406,7 +410,7 @@ gdbtk_test cpp_variable-2.42 {format of v.VA} {
# Desc: value of v.VA changed
gdbtk_test cpp_variable-2.43 {value of v.VA changed} {
check_update
-} {{} {}}
+} {v.private.v_priv_charp {v.private.v_priv_charp v.VB v.private.v_priv_int v.VC v.public.v_pub_charp v.private.v_priv_charp.*v_priv_charp v.public.v_pub_int v.private v.public v.VA}}
# Test: cpp_variable-2.44
# Desc: value of v.VA
@@ -479,7 +483,7 @@ gdbtk_test cpp_variable-2.62 {format of v.VB} {
# Desc: value of v.VB changed
gdbtk_test cpp_variable-2.63 {value of v.VB changed} {
check_update
-} {{} {}}
+} {{} {v.VA.protected v.private.v_priv_charp.*v_priv_charp v.VA.private v.VA.public.va_pub_int v.private.v_priv_int v.public.v_pub_int v.VA.public.va_pub_charp v.private.v_priv_charp v.VA.public v.public.v_pub_charp v.VA.private.va_priv_int v.VA v.public v.VB v.VC v.VA.protected.bar v.VA.private.va_priv_charp v.private}}
# Test: cpp_variable-2.64
# Desc: value of v.VB
@@ -559,7 +563,7 @@ gdbtk_test cpp_variable-2.71a {set variable v->v_pub_int=2112} {
# Desc: value of v.vb_pub_int changed
gdbtk_test cpp_variable-2.72 {value of v.vb_pub_int changed} {
check_update
-} {v.VB.public.vb_pub_int {}}
+} {v.VB.public.vb_pub_int {v.VB.public v.VA.protected v.private.v_priv_charp.*v_priv_charp v.VA.private v.VB.private.vb_priv_int v.VB.private v.VA.public.va_pub_int v.private.v_priv_int v.VB.public.vb_pub_int v.public.v_pub_int v.VB.private.vb_priv_charp v.VA.public.va_pub_charp v.private.v_priv_charp v.VA.public v.public.v_pub_charp v.VA.private.va_priv_int v.VA v.public v.VB v.VC v.VA.protected.bar v.VA.private.va_priv_charp v.private}}
# Test: cpp_variable-2.73
# Desc: value of v.VB.vb_pub_int
@@ -585,4 +589,6 @@ gdbtk_test cpp_variable-2.75 {changed value of v.VB.public.vb_pub_int} {
#
gdbtk_test_done
+#Local Variables:
+#mode: tcl