From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25600 invoked by alias); 19 Apr 2012 16:38:30 -0000 Received: (qmail 25348 invoked by uid 22791); 19 Apr 2012 16:38:28 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MSGID_FROM_MTA_HEADER,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Apr 2012 16:38:13 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Apr 2012 17:38:11 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 19 Apr 2012 17:38:09 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3JGc9sE2613252 for ; Thu, 19 Apr 2012 17:38:09 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3JGc9Ex008790 for ; Thu, 19 Apr 2012 10:38:09 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id q3JGc7YI008735; Thu, 19 Apr 2012 10:38:08 -0600 Message-Id: <201204191638.q3JGc7YI008735@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 19 Apr 2012 18:38:07 +0200 Subject: Re: [commit] [PATCH] Allow 64-bit enum values To: jan.kratochvil@redhat.com (Jan Kratochvil) Date: Thu, 19 Apr 2012 16:58:00 -0000 From: "Ulrich Weigand" Cc: siddhesh@redhat.com (Siddhesh Poyarekar), tromey@redhat.com (Tom Tromey), gdb-patches@sourceware.org In-Reply-To: <20120418065627.GA31851@host2.jankratochvil.net> from "Jan Kratochvil" at Apr 18, 2012 08:56:27 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 12041916-5024-0000-0000-0000024F495B 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: 2012-04/txt/msg00637.txt.bz2 Jan Kratochvil wrote: > +2012-04-18 Siddhesh Poyarekar > + > + * python/py-type.c (convert_field): New variable addrstring. Use > + TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. > --- src/gdb/python/py-type.c 2012/02/17 19:24:26 1.36 > +++ src/gdb/python/py-type.c 2012/04/18 06:46:46 1.37 > @@ -167,11 +167,23 @@ > > if (!field_is_static (&TYPE_FIELD (type, field))) > { > - arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); > + const char *attrstring; > + > + if (TYPE_CODE (type) == TYPE_CODE_ENUM) > + { > + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, field)); > + attrstring = "enumval"; > + } > + else > + { > + arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); > + attrstring = "bitpos"; > + } > + > if (!arg) > goto fail; > > - if (PyObject_SetAttrString (result, "bitpos", arg) < 0) > + if (PyObject_SetAttrString (result, attrstring, arg) < 0) > goto failarg; > } This causes a build failure for me due to: py-type.c: In function 'convert_field': py-type.c:186: warning: passing argument 2 of 'PyObject_SetAttrString' discards qualifiers from pointer target type /usr/include/python2.4/object.h has PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, char *, PyObject *); Maybe this depends on the Python version? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com