This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Make GDB build with python 2.4 again.
- From: "Paul Pluzhnikov" <ppluzhnikov at google dot com>
- To: "Pedro Alves" <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, archer at sourceware dot org
- Date: Sun, 19 Oct 2008 15:46:58 -0700
- Subject: Re: Make GDB build with python 2.4 again.
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta;t=1224456421; bh=1XWkG3/xmwOpz3uUDsTekIytdbo=;h=DomainKey-Signature:Message-ID:Date:From:To:Subject:Cc: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-Disposition:References; b=ld0cOD4Y+Nb4aIKXXO9JIxZ61x2hXw0uZdO1udvmJDLCPWPa0YmvZ1yej4DeY+ElTCos8b5hN7ssoJClGA+lOQ==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns;h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;b=NxQckvqCvA0QVRzMalUyPlr9xt34WDZlZ6F9LrRAR+L+fjd8LzOl+x8fsozkhNMa43vVCZQYLVD27WhlbSM0Ag==
- References: <200810192118.18369.pedro@codesourcery.com>
On Sun, Oct 19, 2008 at 1:18 PM, Pedro Alves <pedro@codesourcery.com> 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 <ppluzhnikov@google.com>
Date: Mon Oct 13 15:54:49 2008 -0700
2008-10-13 Paul Pluzhnikov <ppluzhnikov@google.com>
* 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 <pedro@codesourcery.com>
>
> * python/python-value.c (value_object_methods)
> (value_object_as_number, value_object_as_mapping): Move to bottom
> of file.
Why?
Thanks,
--
Paul Pluzhnikov