From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25291 invoked by alias); 7 Jun 2007 13:30:00 -0000 Received: (qmail 25282 invoked by uid 22791); 7 Jun 2007 13:29:59 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Jun 2007 13:29:56 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l57DTrvk001160 for ; Thu, 7 Jun 2007 09:29:53 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l57DTq1Z005447; Thu, 7 Jun 2007 09:29:52 -0400 Received: from [172.16.14.55] (toner.toronto.redhat.com [172.16.14.55]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l57DTqdN000736; Thu, 7 Jun 2007 09:29:52 -0400 Message-ID: <46680850.4050000@redhat.com> Date: Thu, 07 Jun 2007 14:54:00 -0000 From: Sami Wagiaalla User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: Stan Cox CC: Nurdin Premji , Frysk List Subject: Re: frysk.rt.Frame and frysk.debuginfo.DebugInfo References: <1181166384.3102.313.camel@multics.rdu.redhat.com> In-Reply-To: <1181166384.3102.313.camel@multics.rdu.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00251.txt.bz2 > So we need to come up with a > way to have a single shared DebugInfo. > Factories are a common way of solving this problem. Make the constructor of DebugInfo private and DebugInfo objects can only be created through a DebugInfoFactory which keeps a cache of DebugInfo objects. DebugInfoFactory would take a frame, check the cache and return a DebugInfo object. This by the way also solves the antlr problem. If there is a DebugInfo object per frame, then antlr objects called from within that DebugInfo object are only concered with that objects Frame. Sami Wagiaalla