diff options
author | Tom de Vries <tdevries@suse.de> | 2020-07-30 17:47:37 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-07-30 17:47:37 +0200 |
commit | e12dcc50da18ef4382c02d1f2bb1541251cce45e (patch) | |
tree | e5489802066f8d512ed98a1a3bb644ffda03001e /gdb/testsuite/gdb.fortran | |
parent | 3f853ba38317e5204b8c0465233e4bf5f1f46fba (diff) | |
download | binutils-gdb-e12dcc50da18ef4382c02d1f2bb1541251cce45e.tar.gz |
[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/gdb.fortran')
-rw-r--r-- | gdb/testsuite/gdb.fortran/info-modules.exp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.fortran/info-modules.exp b/gdb/testsuite/gdb.fortran/info-modules.exp index 02e35c207e1..3af3d55e772 100644 --- a/gdb/testsuite/gdb.fortran/info-modules.exp +++ b/gdb/testsuite/gdb.fortran/info-modules.exp @@ -76,7 +76,7 @@ GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "22" \ "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}\\);" @@ -88,7 +88,7 @@ GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*" 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}\\);" @@ -117,9 +117,9 @@ GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "19" \ "${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;" |