[Cython] cygdb gdb script problem

mark florisson markflorisson88 at gmail.com
Tue Mar 29 22:46:00 CEST 2011


On 29 March 2011 22:20, Vitja Makarov <vitja.makarov at gmail.com> wrote:
> 2011/3/29 mark florisson <markflorisson88 at gmail.com>:
>> On 29 March 2011 21:11, Vitja Makarov <vitja.makarov at gmail.com> wrote:
>>> Running cygdb with Cython installed in the system leads to the
>>> following problem:
>>>
>>> vitja at vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py
>>> GNU gdb (GDB) 7.2-ubuntu
>>> Copyright (C) 2010 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-linux-gnu".
>>> For bug reporting instructions, please see:
>>> <http://www.gnu.org/software/gdb/bugs/>.
>>> Traceback (most recent call last):
>>>  File "<string>", line 1, in <module>
>>> ImportError: No module named Debugger
>>> /tmp/tmp1ZvOf9:3: Error in sourced command file:
>>> Error while executing Python code.
>>> (gdb)
>>>
>>> So may be it's better to explicitly specify correct path to Cython
>>> package in gdb script?
>>>
>>> Small example patch is attached.
>>>
>>> --
>>> vitja.
>>>
>>> _______________________________________________
>>> cython-devel mailing list
>>> cython-devel at python.org
>>> http://mail.python.org/mailman/listinfo/cython-devel
>>>
>>>
>>
>> Hmm, when using cygdb it expects Cython to be in the path. I believe
>> your traceback means that it can find Cython, but not Cython.Debugger,
>> right? Are you sure you're using Python 2.6+? It doesn't work with any
>> version below 2.6 as they don't use the TP_FLAGS_*_SUBCLASS tp_flags.
>>
>
> That's correct when cygdb is executed it's executed with right cython version,
> and gdb import system version of cython
>
>> In your patch you probably want to join() the dirname() with
>> os.pardir. However, I don't think it would really solve anything,
>> because if you install Cython, cygdb will be installed in e.g.
>> /usr/bin, so you'd be adding / to the path.
>
> No it will add /usr/lib to path, path is taken from Cython.Debugger.Cygdb
Ah indeed, that code was moved.

>> If you want to run cygdb
>> from the cython/bin directory, then cython should be listed in
>> PYTHONPATH.
>
> Ok. But you may get in trouble importing system version instead of
> development one.

Hmm, PYTHONPATH should come before the default search path. But it is
true that those eggs can do anything, like insert themselves at the
front of the path by putting python code in those .pth files (a gross
hack). So indeed, it sounds like a good idea to insert that path at
the front of sys.path.

> --
> vitja.
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>


More information about the cython-devel mailing list