From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22142 invoked by alias); 28 Aug 2013 18:45:58 -0000 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 Received: (qmail 22133 invoked by uid 89); 28 Aug 2013 18:45:58 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Aug 2013 18:45:58 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7SIjsnf009844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Aug 2013 14:45:54 -0400 Received: from localhost.localdomain (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7SIjqPI018007; Wed, 28 Aug 2013 14:45:53 -0400 Message-ID: <521E4560.3050407@redhat.com> Date: Wed, 28 Aug 2013 18:45:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Paul_Koning@Dell.com CC: tromey@redhat.com, gdb-patches@sourceware.org Subject: Re: [patch] [python] PR python/15461 (gate architecture calls) References: <521DE761.6010403@redhat.com> <87d2oxvgye.fsf@fleche.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00849.txt.bz2 On 28/08/13 19:13, Paul_Koning@Dell.com wrote: > > On Aug 28, 2013, at 1:54 PM, Tom Tromey wrote: > >> Phil> Something I thought about is not allowing gdb.Architecture to be >> Phil> instantiated directly, but I could not think of a clean way to do >> Phil> this. >> >> Did you think of any way? >> It seems like a good thing to prevent. > > Ditto for all the existing types for which direct instantiation doesn't do anything useful. > > I haven't tried this, but judging from the Python docs, if you point the tp_new field of the type object to a function that sets a suitable Python exception, that should do the job. I was not able to make the tp_new call figure out where it was being instantiated from. So I could not tell the difference between: foo = gdb.selected_frame() and foo = gdb.Frame() There is a way if the class constructor takes arguments (ie, foo = gdb.Value(2), but that case is valid in any case). But I only spent a very brief time on it. I am sure there is a way to do it. I will look at it in a little more detail now we think we should make this happen. Cheers Ohil