This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] Update c/c++ varobj testsuite
- From: Keith Seitz <keiths at redhat dot com>
- To: Insight Maling List <insight at sources dot redhat dot com>
- Date: Tue, 15 Jan 2002 10:15:39 -0800 (PST)
- Subject: [PATCH] Update c/c++ varobj testsuite
Hi,
This fixes some more bad assumptions and errors in the varobj testsuites
for us.
Keith
ChangeLog
2002-01-15 Keith Seitz <keiths@redhat.com>
* c_variable.test (1.4,2.14): Remove test for local frame
variables. Varobj now forces evaluation in the current frame
by default.
(2.15): Ignore any changes and only check for out of scope
locals (which is still unsupported).
* cpp_variable.test (1.1): Support alternative names for
local scope.
(1.6a): Catch call to gdb_cmd to prevent an error from
throwing testsuite into la-la land. Add to test.
(1.7): Ignore results from children during step, since
they may or may not change value when the parent changes.
(2.2a): New test incorperating gdb_cmd (also wrapped in
catch).
(2.22a): Likewise.
(2.71a): Likewise.
Patch
Index: testsuite/gdb.gdbtk/c_variable.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/c_variable.test,v
retrieving revision 1.4
diff -p -r1.4 c_variable.test
*** testsuite/gdb.gdbtk/c_variable.test 2001/10/08 21:34:04 1.4
--- testsuite/gdb.gdbtk/c_variable.test 2002/01/15 18:14:17
*************** gdbtk_test_run
*** 173,193 ****
# Desc: create local variables
gdbtk_test c_variable-1.4 {create local variables} {
set results {}
! foreach v {linteger lpinteger lcharacter lpcharacter} {
lappend results [create_variable $v]
}
-
- # Create "llong" differently. Tell it to use the current frame. Test 2.14
- # will check that this works.
- set err [catch {gdb_variable create llong -expr llong -frame ""} v]
- if {!$err} {
- set var(llong) $v
- }
- lappend results $err
-
- foreach v {lplong lfloat lpfloat ldouble lpdouble lsimple lpsimple func} {
- lappend results [create_variable $v]
- }
set results
} {0 0 0 0 0 0 0 0 0 0 0 0 0}
--- 173,181 ----
# Desc: create local variables
gdbtk_test c_variable-1.4 {create local variables} {
set results {}
! foreach v {linteger lpinteger lcharacter lpcharacter llong lplong lfloat lpfloat ldouble lpdouble lsimple lpsimple func} {
lappend results [create_variable $v]
}
set results
} {0 0 0 0 0 0 0 0 0 0 0 0 0}
*************** gdbtk_test c_variable-2.13 {change subro
*** 378,388 ****
# *l = 12
gdb_cmd "step"
# Test: c_variable-2.14
# Desc: change do_locals_tests local llong
! gdbtk_test c_variable-2.14 {change do_locals_tests local llong} {
! check_update
! } {llong {}}
# Leave subroutine1
gdb_cmd "next"
--- 366,378 ----
# *l = 12
gdb_cmd "step"
+ # This test is no longer valid, since varobj now forces
+ # re-evaluation in the current frame by default.
# Test: c_variable-2.14
# Desc: change do_locals_tests local llong
! #gdbtk_test c_variable-2.14 {change do_locals_tests local llong} {
! # check_update
! #} {llong {}}
# Leave subroutine1
gdb_cmd "next"
*************** gdb_cmd "next"
*** 390,397 ****
# Test: c_variable-2.15
# Desc: check for out of scope subroutine1 locals
gdbtk_test *c_variable-2.15 {check for out of scope subroutine1 locals (ops, we don't have a out-of-scope list yet)} {
! check_update
! } {{} {i l}}
# Test: c_variable-2.16
# Desc: names of all editable variables
--- 380,387 ----
# Test: c_variable-2.15
# Desc: check for out of scope subroutine1 locals
gdbtk_test *c_variable-2.15 {check for out of scope subroutine1 locals (ops, we don't have a out-of-scope list yet)} {
! lindex [check_update] 1
! } {i l}
# Test: c_variable-2.16
# Desc: names of all editable variables
Index: testsuite/gdb.gdbtk/cpp_variable.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/cpp_variable.test,v
retrieving revision 1.6
diff -p -r1.6 cpp_variable.test
*** testsuite/gdb.gdbtk/cpp_variable.test 2001/12/20 18:28:35 1.6
--- testsuite/gdb.gdbtk/cpp_variable.test 2002/01/15 18:14:17
*************** gdbtk_test_run
*** 140,147 ****
# Test: cpp_variable-1.1
# Desc: stopped in do_simple_class_tests
gdbtk_test cpp_variable-1.1 {stopped in do_simple_class_tests} {
! lindex [gdb_loc] 1
! } {do_simple_class_tests(void)}
# Test: cpp_variable-1.2
# Desc: create variable v
--- 140,153 ----
# Test: cpp_variable-1.1
# Desc: stopped in do_simple_class_tests
gdbtk_test cpp_variable-1.1 {stopped in do_simple_class_tests} {
! # G++ can output "do_simple_class_tests(void)". Strip the "(void)" part.
! set loc [lindex [gdb_loc] 1]
! set index [string first \( $loc]
! if {$index > 0} {
! set loc [string range $loc 0 [expr {$index-1}]]
! }
! set loc
! } {do_simple_class_tests}
# Test: cpp_variable-1.2
# Desc: create variable v
*************** gdbtk_test cpp_variable-1.6 {format of v
*** 188,201 ****
set value {}
catch {$var(v) value} value
! # Step over "V *v = new V;"
! gdb_cmd "next"
# Test: cpp_variable-1.7
# Desc: check value of v changed
gdbtk_test cpp_variable-1.7 {check value of v changed} {
! check_update
! } {{v v.public.v_pub_int v.public.v_pub_charp v.private.v_priv_int v.private.v_priv_charp} {}}
# Test: cpp_variable-1.8
# Desc: check values of v
--- 194,214 ----
set value {}
catch {$var(v) value} value
! # Test: cpp_variable-1.6a
! # Desc: Step over "V *v = new V;"
! gdbtk_test cpp_variable-1.6a {step over "V *v = new V;"} {
! catch {gdb_cmd "next"}
! } {0}
# Test: cpp_variable-1.7
# 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}
! } {1}
# Test: cpp_variable-1.8
# Desc: check values of v
*************** gdbtk_test cpp_variable-2.2 {format of v
*** 228,234 ****
$var(v.public.v_pub_int) format
} {natural}
! gdb_cmd "set variable v.v_pub_int=2112"
# Test: cpp_variable-2.3
# Desc: value of v.v_pub_int changed
--- 241,256 ----
$var(v.public.v_pub_int) format
} {natural}
! # Test: cpp_variable-2.2a
! # Desc: set variable v->v_pub_int=2112
! gdbtk_test cpp_variable-2.2a {set variable v.v_pub_int=2112} {
! set err [catch {gdb_cmd "set variable v.v_pub_int=2112"} txt]
! if {$err} {
! set txt
! } else {
! set err
! }
! } {0}
# Test: cpp_variable-2.3
# Desc: value of v.v_pub_int changed
*************** gdbtk_test cpp_variable-2.22 {format of
*** 299,305 ****
$var(v.private.v_priv_charp) format
} {natural}
! gdb_cmd "set variable v.v_priv_charp=2112"
# Test: cpp_variable-2.23
# Desc: value of v.v_priv_charp changed
--- 321,336 ----
$var(v.private.v_priv_charp) format
} {natural}
! # Test: cpp_variable-2.22a
! # Desc: set variable v->v_priv_charp=2112
! gdbtk_test cpp_variable-2.22a {set variable v->v_priv_charp=2112} {
! set err [catch {gdb_cmd "set variable v->v_priv_charp=2112"} txt]
! if {$err} {
! set txt
! } else {
! set err
! }
! } {0}
# Test: cpp_variable-2.23
# Desc: value of v.v_priv_charp changed
*************** gdbtk_test cpp_variable-2.71 {v.VB.vb_pu
*** 513,519 ****
$var(v.VB.public.vb_pub_int) editable
} {1}
! gdb_cmd "set variable v.vb_pub_int=2112"
# Test: cpp_variable-2.72
# Desc: value of v.vb_pub_int changed
--- 544,559 ----
$var(v.VB.public.vb_pub_int) editable
} {1}
! # Test: cpp_variable-2.71a
! # Desc: set variable v->vb_pub_int=2112
! gdbtk_test cpp_variable-2.71a {set variable v->v_pub_int=2112} {
! set err [catch {gdb_cmd "set variable v->vb_pub_int=2112"} txt]
! if {$err} {
! set txt
! } else {
! set err
! }
! } {0}
# Test: cpp_variable-2.72
# Desc: value of v.vb_pub_int changed