From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21170 invoked by alias); 5 Jun 2009 00:27:05 -0000 Received: (qmail 21161 invoked by uid 22791); 5 Jun 2009 00:27:04 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Jun 2009 00:26:58 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n550QufP002611 for ; Thu, 4 Jun 2009 20:26:56 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n550QoD3016000; Thu, 4 Jun 2009 20:26:50 -0400 Received: from opsy.redhat.com (vpn-12-161.rdu.redhat.com [10.11.12.161]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n550QnJj029972; Thu, 4 Jun 2009 20:26:49 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 706AA378615; Thu, 4 Jun 2009 18:26:48 -0600 (MDT) To: Sami Wagiaalla Cc: GDB Patches Subject: Re: [PATCH 1/2] namespace support References: <4A16BAB5.80602@redhat.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 05 Jun 2009 00:27:00 -0000 In-Reply-To: <4A16BAB5.80602@redhat.com> (Sami Wagiaalla's message of "Fri\, 22 May 2009 10\:46\:13 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00088.txt.bz2 >>>>> "Sami" == Sami Wagiaalla writes: Sami> Currently imports statements are stored in the nearest static Sami> block. Also, these import statements only correspond to the Sami> implicit importing of annonymous namespaces. This looks pretty reasonable to me. A few nits and such... Sami> +/* This returns the using directives list associated to BLOCK, if Sami> + any. Each BLOCK_NAMESPACE()->USING already contains all the namespaces Sami> + imported at that code point - even those from its parent blocks. */ I think the caps on "USING" here are weird. Maybe just: The result contains all the [...] Sami> +/* using directives local to lexical context */ Comments should in general be sentences -- starting with a capital letter and ending with a period and two spaces. Here I would probably write: /* "using" directives local to lexical context. */ ... avoiding the capital since "using" is a keyword. Sami> +EXTERN struct using_direct *using_directives; Eww, buildsym is full of globals. Not your problem :-), but yet another thing that would be nice to clean up. Sami> + /* Pending using directives at the time we entered */ Likewise about the period and spaces. Sami> - using_list = cp_add_using (name, inner_length, outer_length, Sami> - using_list); Sami> + using_directives = cp_add_using (name, inner_length, outer_length, Sami> + using_directives); Looks like a formatting change; the old code was indented correctly. Sami> +static void Sami> +read_import_statement (struct die_info *die, struct dwarf2_cu *cu) [...] Sami> + if (imported_name == NULL) Sami> + { Sami> + /* C++ imports from std:: DW_TAG_base_type with no DW_AT_name - why? */ It would be nice to understand this before the patch goes in. Sami> + /* FIXME: dwarf2_name (die); for the local name after import. */ It would also be nice if we could not add new FIXMEs. Or is that handled in a later patch? Sami> + using_directives = cp_add_using (imported_name, strlen (imported_name), 0, Sami> + using_directives); Sami> +} I didn't look -- but are there other buildsym globals which are actively updated by the dwarf reader like this? I'm wondering whether this is something that should be hidden inside a call, like a new wrapper for cp_add_using. This is not a big deal. Tom