From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9721 invoked by alias); 13 Aug 2010 14:07:23 -0000 Received: (qmail 9710 invoked by uid 22791); 13 Aug 2010 14:07:23 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Aug 2010 14:07:18 +0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o7DE7F7K024815 for ; Fri, 13 Aug 2010 14:07:15 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7DE7EOi1458222 for ; Fri, 13 Aug 2010 15:07:14 +0100 Received: from d06av03.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o7DE7E7W031567 for ; Fri, 13 Aug 2010 15:07:14 +0100 Received: from leonard.localnet (dyn-9-152-224-25.boeblingen.de.ibm.com [9.152.224.25]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o7DE7A8X031466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Aug 2010 15:07:13 +0100 From: Ken Werner To: Phil Muldoon , Tom Tromey Subject: Re: [patch] Add solib_address and decode_line Python functionality Date: Fri, 13 Aug 2010 14:07:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic-pae; KDE/4.4.2; i686; ; ) Cc: gdb-patches@sourceware.org References: <4C44728D.4040408@redhat.com> <4C613540.9090009@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_NGVZMmNfvEiojSG" Message-Id: <201008131607.09618.ken@linux.vnet.ibm.com> X-IsSubscribed: yes 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/msg00187.txt.bz2 --Boundary-00=_NGVZMmNfvEiojSG Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 680 On Tuesday, August 10, 2010 08:24:09 pm Tom Tromey wrote: > >>>>> "Phil" == Phil Muldoon writes: > Tom> So, could you make this conditional? > > Phil> Sure, what do you think of the attached patch? > > Thanks for persevering. This is ok. Hi, It looks like the const qualifier of the format string argument of the PyArg_Parse* routines has been introduced after the Python 2.4 release: http://svn.python.org/view?view=rev&revision=41638 In case gdb is built against libpython 2.4 the current code would generate a warning. One solution would be to just remove the const qualifier. A small patch is attached. Any comments are appreciated. Thanks Ken --Boundary-00=_NGVZMmNfvEiojSG Content-Type: text/x-patch; charset="UTF-8"; name="python.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="python.patch" Content-length: 889 ChangeLog: 2010-08-13 Ken Werner * gdb/python/python.c (gdbpy_solib_name): Remove the const qualifier of the format strings to be compatible with Python 2.4. Index: gdb/python/python.c =================================================================== RCS file: /cvs/src/src/gdb/python/python.c,v retrieving revision 1.47 diff -p -u -r1.47 python.c --- gdb/python/python.c 11 Aug 2010 20:54:11 -0000 1.47 +++ gdb/python/python.c 13 Aug 2010 13:44:16 -0000 @@ -388,10 +388,11 @@ gdbpy_solib_name (PyObject *self, PyObje PyObject *str_obj; #ifdef PY_LONG_LONG unsigned PY_LONG_LONG pc; - const char *format = "K"; + /* To be compatible with Python 2.4 the format strings are not const. */ + char *format = "K"; #else unsigned long pc; - const char *format = "k"; + char *format = "k"; #endif if (!PyArg_ParseTuple (args, format, &pc)) --Boundary-00=_NGVZMmNfvEiojSG--