From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81921 invoked by alias); 8 Apr 2015 20:39:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 81905 invoked by uid 89); 8 Apr 2015 20:39:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f202.google.com Received: from mail-ig0-f202.google.com (HELO mail-ig0-f202.google.com) (209.85.213.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 08 Apr 2015 20:39:16 +0000 Received: by igdh15 with SMTP id h15so2637349igd.0 for ; Wed, 08 Apr 2015 13:39:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=DbR1G8YY1EOA4oL/+kNc39hXoPtYG5+8mYGn3jOmFRg=; b=RCksvPJfvbdOmY7q5pEOhzUopcrqs9IqTFvD9Wv0rJyZ5p1+PcVqBqiXHKXy+nl2XH swfuS6pucvdKmvyC558hH0FslqVWwpEIVIY0Ug8YP0jVUF3+CxrhYYokvA+mMWsZ7ulD Ft+6nT33/o+MzYzzkDD13uk8s0hplCi/CLyIFuOJ5zC5aPynq0C8D4NBppuXNIuT2lid lM142HXAfgYfpR60fhVrEGPtOsASC0d6dDSxGDne/ZIoJZtvWIj5O5YBrhrGuBWUFyxe xT4sqm/WnDCM1eiY07hC0F+DYFInl1YQj+RKTt6O7g+Ndn8l8QIlma2EfL4Arpz+WxkK KjaQ== X-Gm-Message-State: ALoCoQkKX//5LWozOa3RuwGFnhsTPyMD03dZHnXjskfLiKDqCiIQS8ixlnKur9uE9iPdIbn5d9W0pXYQhmQ9z+KwuGJq8xumzfNG0aL/FlID/P8RfCwXWWJu+LtQio5nNc2iIhe4fzhh/d82FgMtYkD4Urk77R5ZH0C4T1cJ/rTDVwIzXj8Ajao= X-Received: by 10.43.89.69 with SMTP id bd5mr33793180icc.4.1428525554474; Wed, 08 Apr 2015 13:39:14 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id l36si540140yhb.1.2015.04.08.13.39.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 13:39:14 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com ([172.17.128.107]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id YBhzjxHX.1; Wed, 08 Apr 2015 13:39:14 -0700 From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21797.37361.185090.321060@ruffy2.mtv.corp.google.com> Date: Wed, 08 Apr 2015 20:39:00 -0000 To: Sergio Durigan Junior Cc: Keith Seitz , GDB Patches Subject: Re: [PATCH] Fix Python completion when using the "complete" command In-Reply-To: <87384a1jeo.fsf@redhat.com> References: <87d23ovk55.fsf@redhat.com> <87ego4txco.fsf@redhat.com> <87vbh74uqd.fsf@redhat.com> <55257877.3040604@redhat.com> <87384a1jeo.fsf@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00309.txt.bz2 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 > > 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 > > 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?