From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31173 invoked by alias); 13 Sep 2010 18:34:15 -0000 Received: (qmail 31034 invoked by uid 22791); 13 Sep 2010 18:34:14 -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; Mon, 13 Sep 2010 18:34:08 +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 o8DIY6tt016942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Sep 2010 14:34:06 -0400 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 o8DIY5vY007026; Mon, 13 Sep 2010 14:34:06 -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 o8DIY4ww016583; Mon, 13 Sep 2010 14:34:05 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A00D23784BE; Mon, 13 Sep 2010 12:34:04 -0600 (MDT) From: Tom Tromey To: Serge CHATROUX Cc: "gdb-patches\@sourceware.org" Subject: Re: GDB 7.2 - Patch proposal for the use of GDB/Python scripts on MinGW References: <4C8DE078.4090309@st.com> Date: Mon, 13 Sep 2010 19:15:00 -0000 In-Reply-To: (Serge CHATROUX's message of "Mon, 13 Sep 2010 13:44:09 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-09/txt/msg00254.txt.bz2 >>>>> "Serge" =3D=3D Serge CHATROUX writes: Serge> + cmdpy_object_type.tp_new =3D PyType_GenericNew; #endif Tom> Just make your patch do this unconditionally on all hosts, with a Tom> little (one line -- not as long as what you have above) comment Tom> explaining where it is needed. I think that is clearer than using Tom> #ifdef all over. Serge> I do not know how to avoid the '#if __MINGW32__' because this Serge> modification is not needed for other systems (Linux, cygwin). You can just use the MinGW code everywhere. Serge> It seems that Daniel Jacobowitz succeed in compiling gdb over Serge> MINGW without this modification. Yeah, I don't know about that. But, from http://docs.python.org/extending/newtypes.html: We=E2=80=99d like to just assign this to the tp_new slot, but we can=E2= =80=99t, for portability sake, On some platforms or compilers, we can=E2=80=99t stat= ically initialize a structure member with a function defined in another C module, so, instead, we=E2=80=99ll assign the tp_new slot in the module initialization function just before calling PyType_Ready(): So it seems your change might be needed at least sometimes. Tom> Perhaps this code and some surrounding code should be refactored so Tom> that we can just avoid FILE* and use the same code path on all Tom> hosts. Serge> It could be great. I don't know the name of the Python scripting Serge> support maintainers. It could be great to have their feedback. If you want to do it, it is fine. Serge> I set this feature to solve an issue that I had on Linux: Serge> - I compiled Python support without the --enabled-shared support.=20 Ok. How does Python usually work in this setup? Serge> gdb Serge> 'import site' failed; use -v for traceback It seems that we could catch this error and disable the python support at that time. This error is very misleading because "gdb -v" won't actually help. Ugh. Tom