From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6848 invoked by alias); 31 Aug 2010 22:05:50 -0000 Received: (qmail 6840 invoked by uid 22791); 31 Aug 2010 22:05:50 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 31 Aug 2010 22:05:43 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7VM5g85002585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 Aug 2010 18:05:42 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7VM5fEV010050; Tue, 31 Aug 2010 18:05:42 -0400 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 o7VM5f9t018427; Tue, 31 Aug 2010 18:05:41 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id DD2C63792BC; Tue, 31 Aug 2010 16:05:40 -0600 (MDT) From: Tom Tromey To: sami wagiaalla Cc: gdb-patches@sourceware.org Subject: Re: [patch 1/3] Template Lookup References: <4C446F1C.60507@redhat.com> <4C460A3E.2040004@redhat.com> <4C7690B4.7020504@redhat.com> Date: Tue, 31 Aug 2010 22:05:00 -0000 In-Reply-To: <4C7690B4.7020504@redhat.com> (sami wagiaalla's message of "Thu, 26 Aug 2010 12:05:08 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.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: 2010-08/txt/msg00581.txt.bz2 >>>>> "Sami" == sami wagiaalla writes: Sami> Hmm.. can you give me an example of this ? I tried to construct an Sami> example with an extern function but I learned that cplus does not Sami> allow extern template functions. Ordinarily, to make a test involving psymtab expansion, you have to make two compilation units. Put this into one file: template double f (T x) { return x; } int g (void) { return f(1.0) + f(2); } Put this in another file: extern int g(void); int main() { return g(); } Compile, debug, and "start". Now in main: (gdb) p f(1.0) No symbol "f" in current context. (gdb) p f(1.0) $1 = 1 ... but if you step into g, it works: (gdb) s g () at q1.cc:5 5 return f(1.0) + f(2); (gdb) p f(1.0) $2 = 1 Tom> There are a couple instances of this that have to be updated in light of Tom> Doug's recent change to how this is done. Sami> What is the change that Doug made ? He added various set_lang_ functions. Maybe I'm mistaken about the need for this, as there doesn't seem to be a special function for C++. Tom