public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* readline in gdb (python)
@ 2015-02-23 17:30 mobi phil
  0 siblings, 0 replies; only message in thread
From: mobi phil @ 2015-02-23 17:30 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-23 17:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 17:30 readline in gdb (python) mobi phil

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