public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: update for Python 2.7
@ 2010-07-06 18:23 Tom Tromey
  2010-07-26 21:28 ` Michael Snyder
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2010-07-06 18:23 UTC (permalink / raw)
  To: gdb-patches

I am checking this in.

Python 2.7 was recently released.  This patch updates GDB to build
correctly against it.

I built this on my x86 box, with a local Python 2.7 build.
I ran the gdb.python tests with the new gdb without errors.

Tom

2010-07-06  Tom Tromey  <tromey@redhat.com>

	* configure, config.in: Rebuild.
	* configure.ac (HAVE_LIBPYTHON2_7): New define.
	* python/python-internal.h: Handle HAVE_LIBPYTHON2_7.

diff --git a/gdb/configure.ac b/gdb/configure.ac
index 7ddb67f..bfe1803 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -792,7 +792,9 @@ else
                        ${python_includes}, "${python_libs} -lpython2.4")
     fi
   fi
-  if test "${have_libpython}" = python2.6; then
+  if test "${have_libpython}" = python2.7; then
+    AC_DEFINE(HAVE_LIBPYTHON2_7, 1, [Define if Python 2.7 is being used.])
+  elif test "${have_libpython}" = python2.6; then
     AC_DEFINE(HAVE_LIBPYTHON2_6, 1, [Define if Python 2.6 is being used.])
   elif test "${have_libpython}" = python2.5; then
     AC_DEFINE(HAVE_LIBPYTHON2_5, 1, [Define if Python 2.5 is being used.])
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 5bd2a4b..5e0ed18 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -47,6 +47,9 @@ typedef int Py_ssize_t;
 #elif HAVE_LIBPYTHON2_6
 #include "python2.6/Python.h"
 #include "python2.6/frameobject.h"
+#elif HAVE_LIBPYTHON2_7
+#include "python2.7/Python.h"
+#include "python2.7/frameobject.h"
 #else
 #error "Unable to find usable Python.h"
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-06 18:23 FYI: update for Python 2.7 Tom Tromey
@ 2010-07-26 21:28 ` Michael Snyder
  2010-07-26 21:38   ` Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-07-26 21:28 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Tom Tromey wrote:
> I am checking this in.
> 
> Python 2.7 was recently released.  This patch updates GDB to build
> correctly against it.
> 
> I built this on my x86 box, with a local Python 2.7 build.
> I ran the gdb.python tests with the new gdb without errors.
> 
> Tom

Do we need a separate change for --with-python=?

checking whether to use python... /build/toolchain/lin32/python-2.6/
configure: error: invalid value for --with-python
make[1]: *** [configure-gdb] Error 1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-26 21:28 ` Michael Snyder
@ 2010-07-26 21:38   ` Mike Frysinger
  2010-07-26 22:11     ` Michael Snyder
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2010-07-26 21:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Michael Snyder, Tom Tromey

[-- Attachment #1: Type: Text/Plain, Size: 730 bytes --]

On Monday, July 26, 2010 17:27:57 Michael Snyder wrote:
> Tom Tromey wrote:
> > I am checking this in.
> > 
> > Python 2.7 was recently released.  This patch updates GDB to build
> > correctly against it.
> > 
> > I built this on my x86 box, with a local Python 2.7 build.
> > I ran the gdb.python tests with the new gdb without errors.
> 
> Do we need a separate change for --with-python=?
> 
> checking whether to use python... /build/toolchain/lin32/python-2.6/
> configure: error: invalid value for --with-python
> make[1]: *** [configure-gdb] Error 1

when does "--with-python=" make sense ?  i can understand --with-python, but 
not that trailing "=" ... that does sound like an invalid value to me
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-26 21:38   ` Mike Frysinger
@ 2010-07-26 22:11     ` Michael Snyder
  2010-07-27 16:10       ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-07-26 22:11 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, Tom Tromey

Mike Frysinger wrote:
> On Monday, July 26, 2010 17:27:57 Michael Snyder wrote:
>> Tom Tromey wrote:
>>> I am checking this in.
>>>
>>> Python 2.7 was recently released.  This patch updates GDB to build
>>> correctly against it.
>>>
>>> I built this on my x86 box, with a local Python 2.7 build.
>>> I ran the gdb.python tests with the new gdb without errors.
>> Do we need a separate change for --with-python=?
>>
>> checking whether to use python... /build/toolchain/lin32/python-2.6/
>> configure: error: invalid value for --with-python
>> make[1]: *** [configure-gdb] Error 1
> 
> when does "--with-python=" make sense ?  i can understand --with-python, but 
> not that trailing "=" ... that does sound like an invalid value to me
> -mike

Sorry, --with-python=/build/toolchain/lin32/python-2.6

Which is of course a local install location.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-26 22:11     ` Michael Snyder
@ 2010-07-27 16:10       ` Tom Tromey
  2010-07-28 17:06         ` Michael Snyder
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2010-07-27 16:10 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Mike Frysinger, gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

Michael> Sorry, --with-python=/build/toolchain/lin32/python-2.6

Michael> Which is of course a local install location.

Try --with-python=/build/toolchain/lin32/python-2.6/bin/python.
I don't think my 2.7 patch changed this, it was an earlier change.

From gdb/configure.ac:

dnl There are several different values for --with-python:
[...]
dnl /path/to/python/exec-prefix -
dnl        Use the python located in this directory.
dnl        If /path/to/python/exec-prefix/bin/python exists, use it to find
dnl        the compilation parameters.  Otherwise use
dnl        -I/path/to/python/exec-prefix/include,
dnl        -L/path/to/python/exec-prefix/lib.
dnl        Python 2.6, 2.5, and then 2.4 are tried in turn.
dnl        NOTE: This case is historical.  It is what was done for 7.0/7.1
dnl        but is deprecated.
dnl /path/to/python/executable -
dnl        Run python-config.py with this version of python to fetch the
dnl        compilation parameters.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-27 16:10       ` Tom Tromey
@ 2010-07-28 17:06         ` Michael Snyder
  2010-07-29 21:04           ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-07-28 17:06 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Mike Frysinger, gdb-patches

I'm no expert in this stuff, but don't we need a new 2.7 entry in
this region of configure.ac?

   if test "${have_python_config}" = yes; then
     python_version=`echo " ${python_libs} " \
                          | sed -e 's,^.* 
-l\(python[[0-9]]*[[.]][[0-9]]*\) .*$,\
\1,'`
     case "${python_version}" in
     python*)
       AC_TRY_LIBPYTHON(${python_version}, have_libpython,
                        ${python_includes}, ${python_libs})
       ;;
     *)
       AC_MSG_ERROR([unable to determine python version from 
${python_libs}])
       ;;
     esac
   elif test "${have_python_config}" != failed; then
     if test "${have_libpython}" = no; then
       AC_TRY_LIBPYTHON(python2.6, have_libpython,
                        ${python_includes}, "${python_libs} -lpython2.6")
     fi
     if test ${have_libpython} = no; then
       AC_TRY_LIBPYTHON(python2.5, have_libpython,
                        ${python_includes}, "${python_libs} -lpython2.5")
     fi
     if test ${have_libpython} = no; then
       AC_TRY_LIBPYTHON(python2.4, have_libpython,
                        ${python_includes}, "${python_libs} -lpython2.4")
     fi
   fi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-28 17:06         ` Michael Snyder
@ 2010-07-29 21:04           ` Tom Tromey
  2010-07-30  0:03             ` Doug Evans
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2010-07-29 21:04 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Mike Frysinger, gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

Michael> I'm no expert in this stuff, but don't we need a new 2.7 entry in
Michael> this region of configure.ac?

Yes, I think so.

I will try to do it the week after next.
If you want, file a bug and assign it to me.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-29 21:04           ` Tom Tromey
@ 2010-07-30  0:03             ` Doug Evans
  2010-07-30 15:59               ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2010-07-30  0:03 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Michael Snyder, Mike Frysinger, gdb-patches

On Thu, Jul 29, 2010 at 2:03 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:
>
> Michael> I'm no expert in this stuff, but don't we need a new 2.7 entry in
> Michael> this region of configure.ac?
>
> Yes, I think so.
>
> I will try to do it the week after next.
> If you want, file a bug and assign it to me.
>
> Tom

I'm happy to do it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: FYI: update for Python 2.7
  2010-07-30  0:03             ` Doug Evans
@ 2010-07-30 15:59               ` Tom Tromey
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2010-07-30 15:59 UTC (permalink / raw)
  To: Doug Evans; +Cc: Michael Snyder, Mike Frysinger, gdb-patches

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> I'm happy to do it.

Thanks for the offer, but I went ahead and did it this morning.

Here is what I am checking in.
I am putting it on the 7.2 branch as well.

Tom

2010-07-30  Tom Tromey  <tromey@redhat.com>

	* configure: Rebuild.
	* configure.ac: Add missing case for Python 2.7.

Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.127
diff -u -r1.127 configure.ac
--- configure.ac	28 Jul 2010 23:24:57 -0000	1.127
+++ configure.ac	30 Jul 2010 15:58:03 -0000
@@ -622,7 +622,7 @@
 dnl yes -  Include python support, error if it's missing.
 dnl        If we find python in $PATH, use it to fetch configure options,
 dnl        otherwise assume the compiler can find it with no help from us.
-dnl        Python 2.6, 2.5, and then 2.4 are tried in turn.
+dnl        Python 2.7, 2.6, 2.5, and then 2.4 are tried in turn.
 dnl auto - Same as "yes", but if python is missing from the system,
 dnl        fall back to "no".
 dnl /path/to/python/exec-prefix -
@@ -631,7 +631,7 @@
 dnl        the compilation parameters.  Otherwise use
 dnl        -I/path/to/python/exec-prefix/include,
 dnl        -L/path/to/python/exec-prefix/lib.
-dnl        Python 2.6, 2.5, and then 2.4 are tried in turn.
+dnl        Python 2.7, 2.6, 2.5, and then 2.4 are tried in turn.
 dnl        NOTE: This case is historical.  It is what was done for 7.0/7.1
 dnl        but is deprecated.
 dnl /path/to/python/executable -
@@ -780,6 +780,10 @@
     esac
   elif test "${have_python_config}" != failed; then
     if test "${have_libpython}" = no; then
+      AC_TRY_LIBPYTHON(python2.7, have_libpython,
+                       ${python_includes}, "${python_libs} -lpython2.7")
+    fi
+    if test "${have_libpython}" = no; then
       AC_TRY_LIBPYTHON(python2.6, have_libpython,
                        ${python_includes}, "${python_libs} -lpython2.6")
     fi

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-30 15:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 18:23 FYI: update for Python 2.7 Tom Tromey
2010-07-26 21:28 ` Michael Snyder
2010-07-26 21:38   ` Mike Frysinger
2010-07-26 22:11     ` Michael Snyder
2010-07-27 16:10       ` Tom Tromey
2010-07-28 17:06         ` Michael Snyder
2010-07-29 21:04           ` Tom Tromey
2010-07-30  0:03             ` Doug Evans
2010-07-30 15:59               ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).