2016-01-01 04:33:14 +00:00
|
|
|
# Copyright 2006-2016 Free Software Foundation, Inc.
|
2006-03-27 00:27:09 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2006-03-27 00:27:09 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2006-03-27 00:27:09 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2006-03-27 00:27:09 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-03-27 00:27:09 +00:00
|
|
|
|
|
|
|
# Test variable objects treat non-zero offsets in Fortran arrays correctly.
|
|
|
|
|
|
|
|
load_lib mi-support.exp
|
|
|
|
set MIFLAGS "-i=mi"
|
|
|
|
|
* lib/gdb.exp (gdb_compile_test): New.
(skip_ada_tests, skip_java_tests): New.
(gdb_compile): Use gdb_compile_test for f77.
* lib/ada.exp (gdb_compile_ada): Use gdb_compile_test to record result.
* lib/java.exp (compile_java_from_source): Remove runtests check,
use gdb_compile_test to record result.
* gdb.ada/packed_array.exp, gdb.ada/fixed_points.exp,
gdb.ada/exec_changed.exp, gdb.ada/start.exp,
gdb.ada/watch_arg.exp, gdb.ada/null_record.exp,
gdb.ada/array_return.exp, gdb.ada/arrayidx.exp,
gdb.mi/mi-var-child-f.exp, gdb.fortran/types.exp,
gdb.fortran/array-element.exp, gdb.fortran/subarray.exp,
gdb.fortran/derived-type.exp, gdb.fortran/exprs.exp,
gdb.java/jmisc.exp, gdb.java/jmisc1.exp, gdb.java/jprint.exp,
gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
adjust gdb_compile invocations.
2009-11-10 10:16:10 +00:00
|
|
|
if { [skip_fortran_tests] } { return -1 }
|
|
|
|
|
2006-03-27 00:27:09 +00:00
|
|
|
gdb_exit
|
|
|
|
if [mi_gdb_start] {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2012-07-10 15:32:52 +00:00
|
|
|
standard_testfile array.f
|
|
|
|
|
* lib/gdb.exp (gdb_compile_test): New.
(skip_ada_tests, skip_java_tests): New.
(gdb_compile): Use gdb_compile_test for f77.
* lib/ada.exp (gdb_compile_ada): Use gdb_compile_test to record result.
* lib/java.exp (compile_java_from_source): Remove runtests check,
use gdb_compile_test to record result.
* gdb.ada/packed_array.exp, gdb.ada/fixed_points.exp,
gdb.ada/exec_changed.exp, gdb.ada/start.exp,
gdb.ada/watch_arg.exp, gdb.ada/null_record.exp,
gdb.ada/array_return.exp, gdb.ada/arrayidx.exp,
gdb.mi/mi-var-child-f.exp, gdb.fortran/types.exp,
gdb.fortran/array-element.exp, gdb.fortran/subarray.exp,
gdb.fortran/derived-type.exp, gdb.fortran/exprs.exp,
gdb.java/jmisc.exp, gdb.java/jmisc1.exp, gdb.java/jprint.exp,
gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
adjust gdb_compile invocations.
2009-11-10 10:16:10 +00:00
|
|
|
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
|
2013-07-26 18:15:07 +00:00
|
|
|
executable {debug f90}] != ""} {
|
2006-03-27 00:27:09 +00:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
mi_gdb_load ${binfile}
|
|
|
|
|
|
|
|
mi_runto MAIN__
|
|
|
|
|
2013-07-26 18:15:07 +00:00
|
|
|
mi_create_varobj "array" "array" "create local variable array"
|
2006-03-27 00:27:09 +00:00
|
|
|
|
2013-07-26 18:15:07 +00:00
|
|
|
|
|
|
|
# Depending on the compiler version being used, the name of the 4-byte integer
|
|
|
|
# and real types can be printed differently. For instance, gfortran-4.1 uses
|
|
|
|
# "int4" whereas gfortran-4.3 uses "integer(kind=4)".
|
|
|
|
set int4 "(int4|integer\\(kind=4\\))"
|
|
|
|
|
|
|
|
set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \
|
|
|
|
[list "array.0" "0" 2 "$int4 \\(2\\)"] \
|
|
|
|
[list "array.1" "1" 2 "$int4 \\(2\\)"]]
|
|
|
|
|
|
|
|
mi_list_varobj_children "array" $children "get children of array"
|
2006-03-27 00:27:09 +00:00
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children --all-values array.-1" \
|
2013-07-26 18:15:07 +00:00
|
|
|
"\\^done,numchild=\"2\",children=\\\[child=\{name=\"array.-1.1\",exp=\"1\",numchild=\"0\",value=\"11\",type=\"$int4\"\},child=\{name=\"array.-1.2\",exp=\"2\",numchild=\"0\",value=\"21\",type=\"$int4\"\}\\\],has_more=\"0\"" \
|
2006-03-27 00:27:09 +00:00
|
|
|
"get grandchildren of array (children of first element of second index)"
|