readline in gdb (python)
mobi phil <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CAGMoNKvqC7_r=CHcz8ONjLf7ptRC0tWnjZ9ZAmL9iiOxZdbvTQ@mail.gmail.com> |
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