diff options
author | Keven Boell <keven.boell@intel.com> | 2013-11-21 10:54:47 +0100 |
---|---|---|
committer | Keven Boell <keven.boell@intel.com> | 2013-12-06 10:02:16 +0100 |
commit | f84bc21877ea3a58cd77929d9b365fd156df1b33 (patch) | |
tree | d1f332e99c4ff5bf8769f1dbec2690c9af869fdd /gdb/testsuite | |
parent | 8662d513466e5743274a36d12f6b63a524e68c0a (diff) | |
download | gdb-f84bc21877ea3a58cd77929d9b365fd156df1b33.zip gdb-f84bc21877ea3a58cd77929d9b365fd156df1b33.tar.gz gdb-f84bc21877ea3a58cd77929d9b365fd156df1b33.tar.bz2 |
testsuite: introduce index in varobj child eval.
In some languages, e.g. fortran, arrays start with index 1
instead 0. This patch changes the MI library to support testing
varobj children of fortran arrays.
2013-11-21 Keven Boell <keven.boell@intel.com>
testsuite/
* lib/mi-support.exp (mi_list_varobj_children_range): Add
call to mi_list_array_varobj_children_with_index.
(mi_list_array_varobj_children_with_index): New function.
Add parameter to specify array start.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/lib/mi-support.exp | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 070ea72..7c47870 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-12-06 Keven Boell <keven.boell@intel.com> + + * lib/mi-support.exp (mi_list_varobj_children_range): Add + call to mi_list_array_varobj_children_with_index. + (mi_list_array_varobj_children_with_index): New function. + Add parameter to specify array start. + 2013-12-03 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 0c3cdbe..cb7bf90 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1487,9 +1487,18 @@ proc mi_list_varobj_children_range {varname from to numchildren children testnam # Verifies that variable object VARNAME has NUMBER children, # where each one is named $VARNAME.<index-of-child> and has type TYPE. proc mi_list_array_varobj_children { varname number type testname } { + mi_list_array_varobj_children_with_index $varname $number 0 $type $testname +} + +# Same as mi_list_array_varobj_children, but allowing to pass a start index +# for an array. +proc mi_list_array_varobj_children_with_index { varname number start_index \ + type testname } { set t {} + set index $start_index for {set i 0} {$i < $number} {incr i} { - lappend t [list $varname.$i $i 0 $type] + lappend t [list $varname.$index $index 0 $type] + incr index } mi_list_varobj_children $varname $t $testname } |