This is the mail archive of the
mailing list for the GDB project.
readline in gdb (python)
- From: mobi phil <mobi at mobiphil dot com>
- To: gdb at sourceware dot org
- Date: Mon, 23 Feb 2015 18:30:30 +0100
- Subject: readline in gdb (python)
- Authentication-results: sourceware.org; auth=none
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
So I would like to challenge this decision to forbid "import readline"
and to allow it in future
being mobile, but including technology