mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
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.
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user