+2019-10-16 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.fortran/module.exp: Extend with 'info variables' test.
+
2019-10-16 Andrew Burgess <andrew.burgess@embecosm.com>
* boards/cc-with-tweaks.exp: Setup F90_FOR_TARGET and
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+load_lib "fortran.exp"
+
standard_testfile .f90
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } {
continue
}
+set int_type [fortran_int4]
+
+# Test 'info variables' can find module variables.
+gdb_test "info variables -n" \
+ [multi_line \
+ "All defined variables:" \
+ "" \
+ "File .*$srcfile:" \
+ "18:\[ \t\]+${int_type} mod1::var_const;" \
+ "17:\[ \t\]+${int_type} mod1::var_i;" \
+ "23:\[ \t\]+${int_type} mod2::var_i;" \
+ "28:\[ \t\]+${int_type} mod3::mod1;" \
+ "27:\[ \t\]+${int_type} mod3::mod2;" \
+ "29:\[ \t\]+${int_type} mod3::var_i;" \
+ "33:\[ \t\]+${int_type} modmany::var_a;" \
+ "33:\[ \t\]+${int_type} modmany::var_b;" \
+ "33:\[ \t\]+${int_type} modmany::var_c;" \
+ "33:\[ \t\]+${int_type} modmany::var_i;" \
+ "37:\[ \t\]+${int_type} moduse::var_x;" \
+ "37:\[ \t\]+${int_type} moduse::var_y;" ]
+
+
# Do not use simple single-letter names as GDB would pick up for expectedly
# nonexisting symbols some static variables from system libraries debuginfos.