From: Doug Evans <dje@google.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Keith Seitz <keiths@redhat.com>,
GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix Python completion when using the "complete" command
Date: Wed, 08 Apr 2015 20:39:00 -0000 [thread overview]
Message-ID: <21797.37361.185090.321060@ruffy2.mtv.corp.google.com> (raw)
In-Reply-To: <87384a1jeo.fsf@redhat.com>
Sergio Durigan Junior writes:
> On Wednesday, April 08 2015, Keith Seitz wrote:
>
> >>> >+ This function is usually called twice: one when we are figuring out
> >
> > nitpick (sorry): "once" instead of "one"
>
> Thanks, fixed.
>
> > This looks good to me.
> >
> > I have applied this patch to my completer branch, and I can verify
> > that it fixes the (other) completion problems I've seen. I recommend
> > that a maintainer approve this.
>
> Thanks for the review, Keith!
>
> Here is the updated patch + ChangeLog entry.
>
> --
> Sergio
> GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
> Please send encrypted e-mail if possible
> http://sergiodj.net/
>
> gdb/ChangeLog:
> 2015-04-08 Sergio Durigan Junior <sergiodj@redhat.com>
>
> PR python/16699
> * python/py-cmd.c (cmdpy_completer_helper): Adjust function to not
> use a caching mechanism. Adjust comments and code to reflect
> that. Replace 'sizeof' by 'strlen' when fetching 'wordobj'.
> (cmdpy_completer_handle_brkchars): Adjust call to
> cmdpy_completer_helper. Call Py_XDECREF for 'resultobj'.
> (cmdpy_completer): Likewise.
>
> gdb/testsuite/ChangeLog:
> 2015-04-08 Keith Seitz <keiths@redhat.com>
>
> PR python/16699
> * gdb.python/py-completion.exp: New tests for completion.
> * gdb.python/py-completion.py (CompleteLimit1): New class.
> (CompleteLimit2): Likewise.
> (CompleteLimit3): Likewise.
> (CompleteLimit4): Likewise.
> (CompleteLimit5): Likewise.
> (CompleteLimit6): Likewise.
> (CompleteLimit7): Likewise.
LGTM.
One comment below.
> + resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst,
> + textobj, wordobj, NULL);
> + Py_DECREF (textobj);
> + Py_DECREF (wordobj);
> + if (!resultobj)
> + {
> + /* Just swallow errors here. */
> + PyErr_Clear ();
> }
I realize this is just copying the previous code,
but does swallowing errors here make it hard to debug problems
in the completer function?
Is this something we want to address in a future patch?
next prev parent reply other threads:[~2015-04-08 20:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 23:10 Sergio Durigan Junior
2015-04-01 2:07 ` Sergio Durigan Junior
2015-04-07 19:13 ` Sergio Durigan Junior
2015-04-08 18:50 ` Keith Seitz
2015-04-08 19:59 ` Sergio Durigan Junior
2015-04-08 20:39 ` Doug Evans [this message]
2015-04-08 22:29 ` Sergio Durigan Junior
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=21797.37361.185090.321060@ruffy2.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--cc=sergiodj@redhat.com \
/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