* PyInt_Type undeclared
@ 2013-02-28 19:22 Simeon S
2013-02-28 19:56 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Simeon S @ 2013-02-28 19:22 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 625 bytes --]
Hi guys,
While building gdb-7.5.50.20130228 against Python 3.3.0 I encountered
the error (build log attached):
./python/py-arch.c:114: error: `PyInt_Type' undeclared (first use in
this function)
./python/py-arch.c:114: error: (Each undeclared identifier is reported only once
./python/py-arch.c:114: error: for each function it appears in.)
make[2]: *** [py-arch.o] Error 1
The simple fix is to add the following line to python-internal.h
preferably at line 64 :) :
#define PyInt_Type PyLong_Type
Could you please include me in correspondence with regards to this as
I'm not subscribed to the mailer.
Simeon Simeonov
[-- Attachment #2: build.log.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 1736 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PyInt_Type undeclared
2013-02-28 19:22 PyInt_Type undeclared Simeon S
@ 2013-02-28 19:56 ` Tom Tromey
2013-02-28 20:03 ` Simeon S
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2013-02-28 19:56 UTC (permalink / raw)
To: Simeon S; +Cc: gdb-patches
>>>>> "Simeon" == Simeon S <simeon.simeonov.s@gmail.com> writes:
Simeon> While building gdb-7.5.50.20130228 against Python 3.3.0 I
Simeon> encountered the error (build log attached):
Could you try this patch?
Tom
2013-02-28 Tom Tromey <tromey@redhat.com>
* python/py-arch.c (archpy_disassemble): Use PyInt_Check and
PyLong_Check.
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c
index b41de06..ddfebdb 100644
--- a/gdb/python/py-arch.c
+++ b/gdb/python/py-arch.c
@@ -111,12 +111,12 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
start = start_temp;
if (end_obj)
{
- if (PyObject_TypeCheck (end_obj, &PyInt_Type))
+ if (PyLong_Check (end_obj))
+ end = PyLong_AsUnsignedLongLong (end_obj);
+ else if (PyInt_Check (end_obj))
/* If the end_pc value is specified without a trailing 'L', end_obj will
be an integer and not a long integer. */
end = PyInt_AsLong (end_obj);
- else if (PyObject_TypeCheck (end_obj, &PyLong_Type))
- end = PyLong_AsUnsignedLongLong (end_obj);
else
{
Py_DECREF (end_obj);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PyInt_Type undeclared
2013-02-28 19:56 ` Tom Tromey
@ 2013-02-28 20:03 ` Simeon S
2013-02-28 20:26 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Simeon S @ 2013-02-28 20:03 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
Seems to be compiling fine. For reference:
simeon % gdb --version
GNU gdb (GDB) 7.5.50.20130228
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
simeon % python --version
Python 3.3.0
Simeon
On 28 February 2013 19:41, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Simeon" == Simeon S <simeon.simeonov.s@gmail.com> writes:
>
> Simeon> While building gdb-7.5.50.20130228 against Python 3.3.0 I
> Simeon> encountered the error (build log attached):
>
> Could you try this patch?
>
> Tom
>
> 2013-02-28 Tom Tromey <tromey@redhat.com>
>
> * python/py-arch.c (archpy_disassemble): Use PyInt_Check and
> PyLong_Check.
>
> diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c
> index b41de06..ddfebdb 100644
> --- a/gdb/python/py-arch.c
> +++ b/gdb/python/py-arch.c
> @@ -111,12 +111,12 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
> start = start_temp;
> if (end_obj)
> {
> - if (PyObject_TypeCheck (end_obj, &PyInt_Type))
> + if (PyLong_Check (end_obj))
> + end = PyLong_AsUnsignedLongLong (end_obj);
> + else if (PyInt_Check (end_obj))
> /* If the end_pc value is specified without a trailing 'L', end_obj will
> be an integer and not a long integer. */
> end = PyInt_AsLong (end_obj);
> - else if (PyObject_TypeCheck (end_obj, &PyLong_Type))
> - end = PyLong_AsUnsignedLongLong (end_obj);
> else
> {
> Py_DECREF (end_obj);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PyInt_Type undeclared
2013-02-28 20:03 ` Simeon S
@ 2013-02-28 20:26 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2013-02-28 20:26 UTC (permalink / raw)
To: Simeon S; +Cc: gdb-patches
>>>>> "Simeon" == Simeon S <simeon.simeonov.s@gmail.com> writes:
Simeon> Seems to be compiling fine. For reference:
Thanks. I'm going to check it in.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-28 20:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 19:22 PyInt_Type undeclared Simeon S
2013-02-28 19:56 ` Tom Tromey
2013-02-28 20:03 ` Simeon S
2013-02-28 20:26 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox