From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17332 invoked by alias); 17 Apr 2009 16:19:49 -0000 Received: (qmail 17318 invoked by uid 22791); 17 Apr 2009 16:19:46 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Apr 2009 16:19:41 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1E1A72BACB5 for ; Fri, 17 Apr 2009 12:19:40 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dvBZSE6ZwAIT for ; Fri, 17 Apr 2009 12:19:40 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 392CB2BACAB for ; Fri, 17 Apr 2009 12:19:39 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1B6E4F58C1; Fri, 17 Apr 2009 09:19:34 -0700 (PDT) Date: Fri, 17 Apr 2009 17:32:00 -0000 From: Joel Brobecker To: gdb@sourceware.org Subject: [Ada/dwarf] New DW_AT_GNAT_descriptive_type DWARF attribute... Message-ID: <20090417161934.GW7585@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00142.txt.bz2 GDB developers, For debugging Ada, part of the information that we need is stored in symbol names following a specific encoding. This encoding is documented in the GCC sources, file exp_dbug.ads. The reason behind this encoding is that older debugging info formats such as stabs were too limited to express some of the Ada features: variant records (structs whose definition and size may change depending on context), renamings, etc. DWARF comes much closer to allowing us to express those features. There are still a few unknowns that we haven't quite resolved yet, but it's close. However, as much as I would personally like to see stabs disappear, it's still there, so we have to continue to support AdaCore's encoding. Similarly, we haven't had time to look into reducing the use of the encoding when using DWARF. A few years ago, we introduced a new attribute named DW_AT_GNAT_descriptive_type, whose purpose was to provide a direct link from a type to its parallel type. For instance, for certain array types, the array bounds are expressed through a parallel type whose name is the same as the array type, but with an extra ___XA suffix. What GDB needs to do, then, is search all the types to see if it can find a type with that ___XA suffix. The new attribute makes that search instantaneous. At the time, we had hoped that this would be a temporary, local change, until we find the time to work on generating pure DWARF. But the reality is that we don't see this happening in the near future. As we've come to accept this fact, we at AdaCore think that it would be useful to others to be able to take advantage of this attribute. The changes in GDB are relatively small, I think - at least in the DWARF reader part. We added a field in the gnat_specific part of struct type, and I can see how it could trigger some protests. But we can discuss the specifics of the patch if there are no objections to this new attribute. -- Joel