public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Building GDB with PyPy?
@ 2014-08-06  0:46 Yichun Zhang (agentzh)
  2014-08-19 14:22 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Yichun Zhang (agentzh) @ 2014-08-06  0:46 UTC (permalink / raw)
  To: gdb

Hi folks!

Sorry if this is a dumb question.

I've been using the Python extension in gdb but the speed of the
Python code is very disappointing for large working set. I wonder if
it is possible to build gdb from source with pypy instead of the
cpython?

Using ./configure --with-python=`which pypy` fails for me with the
following error:

checking whether to use python... /bin/pypy
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "./python/python-config.py", line 66, in <module>
    libs.append('-lpython'+pyver + abiflags)
TypeError: unsupported operand type(s) for +: 'str' and 'NoneType'
configure: error: failure running python-config --ldflags
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/agentzh/Downloads/gdb-7.8'
make: *** [all] Error 2

Any pointers for solving this will be highly appreciated!

Hopefully PyPy can speed up my Python code running in gdb a lot. Just
want to give it a shot.

Thanks!
-agentzh

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

* Re: Building GDB with PyPy?
  2014-08-06  0:46 Building GDB with PyPy? Yichun Zhang (agentzh)
@ 2014-08-19 14:22 ` Pedro Alves
  2014-08-19 15:49   ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-08-19 14:22 UTC (permalink / raw)
  To: Yichun Zhang (agentzh), gdb

On 08/06/2014 01:46 AM, Yichun Zhang (agentzh) wrote:
> Hi folks!
> 
> Sorry if this is a dumb question.
> 
> I've been using the Python extension in gdb but the speed of the
> Python code is very disappointing for large working set. I wonder if
> it is possible to build gdb from source with pypy instead of the
> cpython?

I have no idea if anyone ever done that, but if you succeed, don't
forget to let us know about it! :-)

> 
> Using ./configure --with-python=`which pypy` fails for me with the
> following error:
> 
> checking whether to use python... /bin/pypy
> Traceback (most recent call last):
>   File "app_main.py", line 72, in run_toplevel
>   File "./python/python-config.py", line 66, in <module>
>     libs.append('-lpython'+pyver + abiflags)
> TypeError: unsupported operand type(s) for +: 'str' and 'NoneType'
> configure: error: failure running python-config --ldflags
> make[1]: *** [configure-gdb] Error 1
> make[1]: Leaving directory `/home/agentzh/Downloads/gdb-7.8'
> make: *** [all] Error 2
> 
> Any pointers for solving this will be highly appreciated!
> 
> Hopefully PyPy can speed up my Python code running in gdb a lot. Just
> want to give it a shot.

-- 
Thanks,
Pedro Alves

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

* Re: Building GDB with PyPy?
  2014-08-19 14:22 ` Pedro Alves
@ 2014-08-19 15:49   ` Simon Marchi
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2014-08-19 15:49 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Yichun Zhang (agentzh), gdb

So,

    pyver = sysconfig.get_config_var('VERSION')

seems undefined (results in None) for PyPy. I replaced it with

    pyver = sysconfig.get_config_var('VERSION') or
sysconfig.get_python_version()

as found in another project, and it seemed to go further. However, the
C api used by GDB seems specific to cpython. There are a lot of
functions not found in PyPy, such as Py_Initialize. I did not go any
further, it doesn't seem like a trivial task to make GDB work with
PyPy.

Here is an exceprt from compilation: http://pastebin.com/SJxdC00i

Simon

On 19 August 2014 10:22, Pedro Alves <palves@redhat.com> wrote:
> On 08/06/2014 01:46 AM, Yichun Zhang (agentzh) wrote:
>> Hi folks!
>>
>> Sorry if this is a dumb question.
>>
>> I've been using the Python extension in gdb but the speed of the
>> Python code is very disappointing for large working set. I wonder if
>> it is possible to build gdb from source with pypy instead of the
>> cpython?
>
> I have no idea if anyone ever done that, but if you succeed, don't
> forget to let us know about it! :-)
>
>>
>> Using ./configure --with-python=`which pypy` fails for me with the
>> following error:
>>
>> checking whether to use python... /bin/pypy
>> Traceback (most recent call last):
>>   File "app_main.py", line 72, in run_toplevel
>>   File "./python/python-config.py", line 66, in <module>
>>     libs.append('-lpython'+pyver + abiflags)
>> TypeError: unsupported operand type(s) for +: 'str' and 'NoneType'
>> configure: error: failure running python-config --ldflags
>> make[1]: *** [configure-gdb] Error 1
>> make[1]: Leaving directory `/home/agentzh/Downloads/gdb-7.8'
>> make: *** [all] Error 2
>>
>> Any pointers for solving this will be highly appreciated!
>>
>> Hopefully PyPy can speed up my Python code running in gdb a lot. Just
>> want to give it a shot.
>
> --
> Thanks,
> Pedro Alves
>

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

end of thread, other threads:[~2014-08-19 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06  0:46 Building GDB with PyPy? Yichun Zhang (agentzh)
2014-08-19 14:22 ` Pedro Alves
2014-08-19 15:49   ` Simon Marchi

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).