This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [2/3] RFC - reimplement common block support


On Tue, Aug 21, 2012 at 9:32 AM, Tom Tromey <tromey@redhat.com> wrote:
> We've had a patch in Fedora for a long time that rewrites the Fortran
> common block support.  Recently I looked into another bug in this area,
> and I decided to update the patch and submit it upstream.
>
> This deletes even more mostly dead code from the Fortran support.
>
> Then it introduces COMMON_BLOCK_DOMAIN and a new type,
> fortran_common_block.  A symbol in COMMON_BLOCK_DOMAIN points to a
> fortran_common_block; this is then used to implement "info common".
>
> A new test case is included.
>
> The old code in gdb is quite broken.  read_common_block uses
> decode_locdesc, which is a priori wrong, and which in particular doesn't
> handle TLS -- but gfortran can generate location expressions using TLS
> when using OMP.
>
> I removed the support in read_common_block for a variable in a common
> block using DW_AT_data_member_location.  This is not specified by DWARF
> and, as near as I can tell, was present in old versions of gfortran (and
> perhaps the even older g77, I didn't look), but removed in 2008.
>
> I think this deletion makes the code cleaner.  However, the next patch
> restores it, in case someone thinks it is vital.
>
> Built and regtested on x86-64 Fedora 16.
>
> Tom
>
> 2012-08-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
>             Tom Tromey  <tromey@redhat.com>
>
>         * dwarf2read.c (read_common_block): Rewrite.
>         (new_symbol_full): Handle DW_TAG_common_block.
>         * f-lang.c (head_common_list, find_common_for_function):
>         Remove.
>         * f-lang.h (struct common_entry, struct saved_f77_common,
>         SAVED_F77_COMMON, SAVED_F77_COMMON_PTR, COMMON_ENTRY,
>         COMMON_ENTRY_PTR, head_common_list, find_common_for_function,
>         BLANK_COMMON_NAME_LOCAL): Remove.
>         (struct fortran_common_block): New.
>         * f-valprint.c (list_all_visible_commons): Remove.
>         (info_common_command_for_block): New function.
>         (info_common_command): Use it.
>         * stack.c (iterate_over_block_locals): Special case for
>         COMMON_BLOCK_DOMAIN.
>         * symtab.h (enum domain_enum_tag) <COMMON_BLOCK_DOMAIN>: New
>         constant.
>         (struct general_symbol_info) <value.common_block>: New field.
>         (SYMBOL_VALUE_COMMON_BLOCK): New define.
>
>         * gdb.fortran/common-block.exp: New file.
>         * gdb.fortran/common-block.f90: New file.

Nit: I'd prefer "struct common_block" to "struct fortran_common_block".

OOC, do common blocks end up in .gdb_index?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]