This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

readline in gdb (python)


Hi,

started to implement a gdb wrapper with some python. Among others I
wanted to add some features that would need readline for completion. I
am aware about the gdb completion system, but that is not
satisfactory. Among others I need my own io/select loop. This is not
available in python readline either, but there is a little hack with
ctypes which makes it working.

Unfortunately it is impossible to import readline. The reason I found
is that readline is not reentrant. Not exactly clear what that means
in this situation and what would be the use-case that would be
dangerous if "import readline" would be enabled.

Probably it would be a problem if readline would be called on a python
callback that is already result of a readline completion. In my case
that would not happen, so do not see any problem.

I also tried to import readline with ctypes, but ctypes does not seem
to callbacks that have result non-trivial types like pointer to
c_char_p.

So I would like to challenge this decision to forbid "import readline"
and to allow it in future



rgrds,
mobi phil

-- 
rgrds,
mobi phil

being mobile, but including technology
http://mobiphil.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]