[RFC] fortran: add module names to the symbol table

Agovic, Sanimir sanimir.agovic@intel.com
Wed Feb 27 16:16:00 GMT 2013


> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Tuesday, February 26, 2013 10:11 AM

Thanks for your feedback.

> [...] The patch would be OK as long as you
> restrict the modules scope to only where they are used.
I`ve filed the following PR #15209 for tracking. This will allow me to continue my 
investigation of your proposal regarding vla implementation see [1].

[1] http://sourceware.org/ml/gdb/2012-11/msg00094.html

 -Sanimir

> 
> gfortran -o 20 20.f90 -Wall -g
> ../gdb -batch ./20 -ex 'set trace-commands' -ex 'b 13' -ex r -ex 'p mod1' -ex 'ptype mod1'
> -ex 'p mod2' -ex 'ptype mod2'
> 
> -FSF GDB HEAD:
> +your patched GDB
> 
> (gdb) p mod1
> -No symbol "mod1" in current context.
> +Attempt to use a type name as an expression
> (gdb) ptype mod1
> -No symbol "mod1" in current context.
> +type = module mod1
> 
> This part is OK.
> 
> (gdb) p mod2
> -$1 = 50
> +Attempt to use a type name as an expression
> (gdb) ptype mod2
> -type = integer(kind=4)
> +type = module mod2
> 
> This part is a regression by your patch.
> 
> 
> Thanks,
> Jan
> 
> ------------------------------------------------------------------------------
> 
> module mod1
>         integer :: var_i = 1
> !       integer :: mod1 = 40 ! Error: Symbol 'mod1' at (1) cannot have a type
>         integer :: mod2 = 50
> end module mod1
> 
> module mod2
>         integer :: var_i = 2
> end module mod2
> 
>         subroutine sub1
>         use mod1
>         mod2 = 51
>         end
> 
>         subroutine sub2
>         use mod2
>         var_i = var_i
>         end
> 
>         program module
>         call sub1
>         call sub2
> end
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052



More information about the Gdb-patches mailing list