aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran/module.f90
diff options
context:
space:
mode:
authorKeven Boell <keven.boell@intel.com>2013-11-15 11:32:01 +0100
committerKeven Boell <keven.boell@intel.com>2013-12-19 13:18:21 +0100
commit530e8392d7d5d4a831c5ce0e4cd410e1c4bd166a (patch)
tree42608c61640ecfb4d7d3800e2f27868d355a63f5 /gdb/testsuite/gdb.fortran/module.f90
parent7f9b20bb352768e14cfa7361a82373b8539bebed (diff)
downloadbinutils-530e8392d7d5d4a831c5ce0e4cd410e1c4bd166a.zip
binutils-530e8392d7d5d4a831c5ce0e4cd410e1c4bd166a.tar.gz
binutils-530e8392d7d5d4a831c5ce0e4cd410e1c4bd166a.tar.bz2
fortran: enable ptype/whatis for modules.
Added new domain MODULE_DOMAIN for fortran modules to avoid issues with sharing namespaces (e.g. when a variable currently in scope has the same name as a module). (gdb) ptype modname old> No symbol "modname" in current context. new> type = module modname This fixes PR 15209 and also addresses the issue with sharing namespaces: https://sourceware.org/ml/gdb-patches/2013-02/msg00643.html 2013-11-19 Keven Boell <keven.boell@intel.com> Sanimir Agovic <sanimir.agovic@intel.com> * cp-namespace.c (cp_lookup_nested_symbol): Enable nested lookups for fortran modules. * dwarf2read.c (read_module): Add fortran module to the symbol table. (add_partial_symbol, add_partial_module): Add fortran module to the partial symbol table. (new_symbol_full): Create full symbol for fortran module. * f-exp.y (yylex): Add new module domain to be parsed. * symtab.h: New domain for fortran modules. testsuite/ * gdb.fortran/module.exp: Completion matches fortran module names as well. ptype/whatis on modules return a proper type. Add new check for having the correct scope.
Diffstat (limited to 'gdb/testsuite/gdb.fortran/module.f90')
-rw-r--r--gdb/testsuite/gdb.fortran/module.f9012
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90
index ada7262..d10b1fb 100644
--- a/gdb/testsuite/gdb.fortran/module.f90
+++ b/gdb/testsuite/gdb.fortran/module.f90
@@ -23,6 +23,12 @@ module mod2
integer :: var_i = 2
end module mod2
+module mod3
+ integer :: mod2 = 3
+ integer :: mod1 = 3
+ integer :: var_i = 3
+end module mod3
+
module modmany
integer :: var_a = 10, var_b = 11, var_c = 12, var_i = 14
end module modmany
@@ -43,6 +49,11 @@ end module moduse
var_i = var_i ! i-is-2
end
+ subroutine sub3
+ USE mod3
+ var_i = var_i ! i-is-3
+ END
+
program module
use modmany, only: var_b, var_d => var_c, var_i
@@ -50,6 +61,7 @@ end module moduse
call sub1
call sub2
+ call sub3
if (var_b .ne. 11) call abort
if (var_d .ne. 12) call abort