From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28405 invoked by alias); 10 Nov 2009 22:52:52 -0000 Received: (qmail 28396 invoked by uid 22791); 10 Nov 2009 22:52:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Nov 2009 22:52:46 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAAMqjd0027765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Nov 2009 17:52:45 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAAMqiDf005770; Tue, 10 Nov 2009 17:52:44 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id nAAMqh9c019772; Tue, 10 Nov 2009 17:52:44 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 939083782CF; Tue, 10 Nov 2009 15:52:43 -0700 (MST) From: Tom Tromey To: Sami Wagiaalla Cc: GDB Patches Subject: Re: [patch 2/2] Perform a namespace lookup at every block level References: <4A57512A.7090208@redhat.com> <20090710194949.GA2064@caradoc.them.org> <4A5B68A4.30006@redhat.com> <4A68B91D.2080206@redhat.com> <4A8B0FD9.7010603@redhat.com> <4AA14648.7090600@redhat.com> <4AE09A10.9040703@redhat.com> Reply-To: tromey@redhat.com Date: Tue, 10 Nov 2009 22:52:00 -0000 In-Reply-To: <4AE09A10.9040703@redhat.com> (Sami Wagiaalla's message of "Thu, 22 Oct 2009 13:44:48 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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-11/txt/msg00243.txt.bz2 >>>>> "Sami" == Sami Wagiaalla writes: Sami> + directive_match = search_parents Sami> + ? strncmp (scope, current->import_dest, Sami> + strlen(current->import_dest)) == 0 Sami> + : strcmp (scope, current->import_dest) == 0; In the GNU style a multi-line expression like this has to be surrounded by parens. Put one before 'search_parents' and then another before ';'. Also this is missing a space after 'strlen'. Sami> + /* Mark this import as searched so that the recursive call does not Sami> + search it again. */ Sami> + current->searched = 1; Sami> + sym = cp_lookup_symbol_namespace (current->import_src, Sami> + name, Sami> + linkage_name, Sami> + block, Sami> + domain, Sami> + 0); Sami> + Sami> + current->searched = 0; If cp_lookup_symbol_namespace can throw an exception, then it can leave the wrong setting of 'searched' here. I don't know whether cp_lookup_symbol_namespace can in fact throw, but I tend to assume that most things in GDB can and defensively use cleanups. Do the new tests include a case which exercises this? Sami> diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.exp b/gdb/testsuite/gdb.cp/namespace-recursive.exp Sami> + return -1; s/;// Sami> diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp Sami> + return -1; Likewise. Tom