From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23876 invoked by alias); 15 Aug 2002 21:41:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23783 invoked from network); 15 Aug 2002 21:41:17 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 15 Aug 2002 21:41:17 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id g7FLVFX11184; Thu, 15 Aug 2002 16:31:15 -0500 To: Petr Sorfa Cc: "gdb-patches@sources.redhat.com" Subject: Re: [RFA] Patch for supportinf DW_TAG_module / FORTRAN modules References: <3D34883C.4AAC7EE@caldera.com> From: Jim Blandy Date: Thu, 15 Aug 2002 14:41:00 -0000 In-Reply-To: <3D34883C.4AAC7EE@caldera.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00383.txt.bz2 If I understand this patch correctly, it stores a Fortran module in GDB's symbol table as if it were a C++ structure type, full of static data and function members. A Fortran module gets stored in GDB's symbol table as a LOC_TYPEDEF symbol. Is that right? I'd like to hear other folks' opinions on this. It seems to me like it would work, since a class establishes a scope that behaves very much like a module. Isn't Class::member, where member is a static thingy, very much like Module::member (or whatever the Fortran syntax is)? We already have logic for resolving class scopes; I don't immediately see why module scopes need to behave any differently. But I think a module should be represented by something that calls itself a module, not a typedef. How will people feel reading a comment explaining that a LOC_TYPEDEF for a type with TYPE_CODE_CLASS is how we represent Fortran modules? I'm not sure that counts as good maintenance. Perhaps we should introduce LOC_MODULE, or TYPE_CODE_MODULE. Or maybe this is okay for now. When we provide better support for C++ namespaces, Fortran modules can become a variant of that, which feels like a better fit. But without a better sense of how people feel about this issue, I don't think I can comment specifically on this patch. Petr Sorfa writes: > Hi, > > The patch below provides support for DW_TAG_module which is used to > represent FORTRAN modules, and possibly other language constructs, such > as C++ namespaces. The patch basically provides support for a module as > a C++ class with static members and functions. > > 2002-07-16 Petr Sorfa > > * dwarf2read.c (dwarf2_update_pc_bounds): New function > that updates a die's low and high pc bound. Used to > remedy possible inconsistencies between ELF and DWARF > information. > (dwarf2_get_child_pc_bounds): New function that > calculates the scope bounds of a die's children. > (dwarf2_add_member_fn): Added a new argument that holds > a parent die's tag type. Used to determine whether > a child die's parent is a module and treat the child > die as a static. > (scan_partial_symbol): Support the DW_TAG_module tag. > (add_partial_symbol): Support the DW_TAG_module tag. > (process_die): Supports the DW_TAG_module tag by > treating it as a structure scope. > (read_file_scope): Moved and enhanced some of the code > to create the new dwarf2_get_child_pc_bounds() > function. > (read_structure_scope): Now supports the DW_TAG_module > tag as a class and handles module variables and > functions/subroutines as static members. > (new_symbol): Now supports the DW_TAG_module tag and > adds a module symbol to the global symbol list. > (read_die_type): Now supports the DW_TAG_module tag > as a structure scope.Index: dwarf2read.c