public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: mobi phil <mobi@mobiphil.com>
To: gdb@sourceware.org
Subject: readline in gdb (python)
Date: Mon, 23 Feb 2015 17:30:00 -0000	[thread overview]
Message-ID: <CAGMoNKvqC7_r=CHcz8ONjLf7ptRC0tWnjZ9ZAmL9iiOxZdbvTQ@mail.gmail.com> (raw)

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

                 reply	other threads:[~2015-02-23 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGMoNKvqC7_r=CHcz8ONjLf7ptRC0tWnjZ9ZAmL9iiOxZdbvTQ@mail.gmail.com' \
    --to=mobi@mobiphil.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).