+2020-07-30 Tom de Vries <tdevries@suse.de>
+
+ * lib/sym-info-cmds.exp (GDBInfoModuleSymbols::check_entry_1): Factor
+ out of ...
+ (GDBInfoModuleSymbols::check_entry): ... here.
+ (GDBInfoModuleSymbols::check_optional_entry): New proc.
+ * gdb.fortran/info-modules.exp: Use check_optional_entry for entries
+ related to __def_init_mod1_M1t1 / __vtype_mod1_M1t1 / __copy_mod1_M1t1.
+
2020-07-30 Tom de Vries <tdevries@suse.de>
* gdb.fortran/ptype-on-functions.exp: Make "_t" suffix on
"void mod2::sub_m2_a\\(${integer4}, ${logical4}\\);"
GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "30" \
"${logical4} mod2::sub_m2_b\\(${real4}\\);"
-GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+GDBInfoModuleSymbols::check_optional_entry "${srcfile}" "mod1" "35" \
"void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);"
GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "25" \
"void mod1::sub_m1_a\\(${integer4}\\);"
GDBInfoModuleSymbols::run_command "info module functions -m mod1"
GDBInfoModuleSymbols::check_header \
"All functions in all modules matching regular expression \"mod1\":"
-GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+GDBInfoModuleSymbols::check_optional_entry "${srcfile}" "mod1" "35" \
"void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);"
GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "25" \
"void mod1::sub_m1_a\\(${integer4}\\);"
"${integer4} mod2::mod2_var_1;"
GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "20" \
"${real4} mod2::mod2_var_2;"
-GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "(35)?" \
+GDBInfoModuleSymbols::check_optional_entry "${srcfile}" "mod1" "(35)?" \
"Type m1t1 mod1::__def_init_mod1_M1t1;"
-GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "(35)?" \
+GDBInfoModuleSymbols::check_optional_entry "${srcfile}" "mod1" "(35)?" \
"Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;"
GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "21" \
"${real4} mod1::mod1_var_1;"
# If a matching entry is found then it is removed from the
# _entries list, this allows us to check for duplicates using the
# check_no_entry call.
- proc check_entry { filename module lineno text { testname "" } } {
+ #
+ # If OPTIONAL, don't generate a FAIL for a mismatch, but use UNSUPPORTED
+ # instead.
+ proc check_entry_1 { filename module lineno text optional testname } {
variable _entries
variable _last_command
}
set _entries $new_entries
- gdb_assert { $found_match } $testname
+ if { $optional && ! $found_match } {
+ unsupported $testname
+ } else {
+ gdb_assert { $found_match } $testname
+ }
+ }
+
+ # Call check_entry_1 with OPTIONAL == 0.
+ proc check_entry { filename module lineno text { testname "" } } {
+ check_entry_1 $filename $module $lineno $text 0 $testname
+ }
+
+ # Call check_entry_1 with OPTIONAL == 1.
+ proc check_optional_entry { filename module lineno text { testname "" } } {
+ check_entry_1 $filename $module $lineno $text 1 $testname
}
# Check that there is no entry in the _entries list matching