aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/sym-info-cmds.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-07-30 17:47:37 +0200
committerTom de Vries <tdevries@suse.de>2020-07-30 17:47:37 +0200
commite12dcc50da18ef4382c02d1f2bb1541251cce45e (patch)
treee5489802066f8d512ed98a1a3bb644ffda03001e /gdb/testsuite/lib/sym-info-cmds.exp
parent3f853ba38317e5204b8c0465233e4bf5f1f46fba (diff)
downloadgdb-e12dcc50da18ef4382c02d1f2bb1541251cce45e.zip
gdb-e12dcc50da18ef4382c02d1f2bb1541251cce45e.tar.gz
gdb-e12dcc50da18ef4382c02d1f2bb1541251cce45e.tar.bz2
[gdb/testsuite] Fix gdb.fortran/info-modules.exp with gcc-4.8
When running test-case gdb.fortran/info-modules.exp with gfortran 4.8.5, I get: ... FAIL: gdb.fortran/info-modules.exp: info module functions: \ check for entry 'info-types.f90', '35', \ 'void mod1::__copy_mod1_M1t1\(Type m1t1, Type m1t1\);' FAIL: gdb.fortran/info-modules.exp: info module functions -m mod1: \ check for entry 'info-types.f90', '35', \ 'void mod1::__copy_mod1_M1t1\(Type m1t1, Type m1t1\);' FAIL: gdb.fortran/info-modules.exp: info module variables: \ check for entry 'info-types.f90', '(35)?', \ 'Type m1t1 mod1::__def_init_mod1_M1t1;' FAIL: gdb.fortran/info-modules.exp: info module variables: \ check for entry 'info-types.f90', '(35)?', \ 'Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;' ... With gfortran 7.5.0, we have: ... $ readelf -wi info-modules | egrep "DW_AT_name.*(copy|def_init|vtype)_mod1" <286> DW_AT_name : __def_init_mod1_M1t1 <29f> DW_AT_name : __vtype_mod1_M1t1 <3de> DW_AT_name : __copy_mod1_M1t1 $ ... but with gfortran 4.8.5: ... $ readelf -wi info-modules | egrep "DW_AT_name.*(copy|def_init|vtype)_mod1" $ ... Fix this by allowing these module functions and variables to be missing. Tested on x86_64-linux with gcc 4.8.5 and gcc 7.5.0. gdb/testsuite/ChangeLog: 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.
Diffstat (limited to 'gdb/testsuite/lib/sym-info-cmds.exp')
-rw-r--r--gdb/testsuite/lib/sym-info-cmds.exp21
1 files changed, 19 insertions, 2 deletions
diff --git a/gdb/testsuite/lib/sym-info-cmds.exp b/gdb/testsuite/lib/sym-info-cmds.exp
index 02f8b32..dd769ef 100644
--- a/gdb/testsuite/lib/sym-info-cmds.exp
+++ b/gdb/testsuite/lib/sym-info-cmds.exp
@@ -421,7 +421,10 @@ namespace eval GDBInfoModuleSymbols {
# 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
@@ -458,7 +461,21 @@ namespace eval GDBInfoModuleSymbols {
}
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