From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5778 invoked by alias); 19 Oct 2008 22:47:53 -0000 Received: (qmail 5764 invoked by uid 22791); 19 Oct 2008 22:47:52 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 19 Oct 2008 22:47:06 +0000 Received: from spaceape12.eur.corp.google.com (spaceape12.eur.corp.google.com [172.28.16.146]) by smtp-out.google.com with ESMTP id m9JMl1VP006149 for ; Sun, 19 Oct 2008 23:47:01 +0100 Received: from wa-out-1112.google.com (wafm16.prod.google.com [10.114.189.16]) by spaceape12.eur.corp.google.com with ESMTP id m9JMkxsV017599 for ; Sun, 19 Oct 2008 15:47:00 -0700 Received: by wa-out-1112.google.com with SMTP id m16so779320waf.6 for ; Sun, 19 Oct 2008 15:46:59 -0700 (PDT) Received: by 10.114.234.13 with SMTP id g13mr4819699wah.176.1224456419047; Sun, 19 Oct 2008 15:46:59 -0700 (PDT) Received: by 10.114.78.12 with HTTP; Sun, 19 Oct 2008 15:46:58 -0700 (PDT) Message-ID: <8ac60eac0810191546x2a69de5bw7ed413b298b6fb55@mail.gmail.com> Date: Sun, 19 Oct 2008 22:47:00 -0000 From: "Paul Pluzhnikov" To: "Pedro Alves" Subject: Re: Make GDB build with python 2.4 again. Cc: gdb-patches@sourceware.org, archer@sourceware.org In-Reply-To: <200810192118.18369.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810192118.18369.pedro@codesourcery.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: 2008-10/txt/msg00473.txt.bz2 On Sun, Oct 19, 2008 at 1:18 PM, Pedro Alves wrote: > I'm checking in the attached fix. I get 95 expected passes with > both 2.4 and 2.5. Meanwhile, on 'archer-tromey-python': $ git show 083493c09e01a8e67057b890689883ddbd6bc830 commit 083493c09e01a8e67057b890689883ddbd6bc830 Author: Paul Pluzhnikov Date: Mon Oct 13 15:54:49 2008 -0700 2008-10-13 Paul Pluzhnikov * python/python-internal.h: Fix 64-bit compilation with python2.4 diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 5896907..207d3e4 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -33,8 +33,11 @@ #if HAVE_LIBPYTHON2_4 #include "python2.4/Python.h" -/* Py_ssize_t is not defined until 2.5. */ -typedef Py_intptr_t Py_ssize_t; +/* Py_ssize_t is not defined until 2.5. + Logical type for Py_ssize_t is Py_intptr_t, but that fails in 64-bit + compilation due to several apparent mistakes in python2.4 API, so we + use 'int' instead. */ +typedef int Py_ssize_t; #elif HAVE_LIBPYTHON2_5 #include "python2.5/Python.h" #elif HAVE_LIBPYTHON2_6 Note that in current gdb/python sources, additional changes are required for python2.4 if Py_ssize_t isn't fixed as above ... > 2008-10-19 Pedro Alves > > * python/python-value.c (value_object_methods) > (value_object_as_number, value_object_as_mapping): Move to bottom > of file. Why? Thanks, -- Paul Pluzhnikov