From patchwork Thu Dec 27 19:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 30865 Received: (qmail 15764 invoked by alias); 27 Dec 2018 19:26:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15633 invoked by uid 89); 27 Dec 2018 19:26:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 19:26:46 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 5328E400CCE2B for ; Thu, 27 Dec 2018 13:26:45 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id cbIrg2in1dnCecbIrgB3Di; Thu, 27 Dec 2018 13:26:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ub8MaLnhK2T6PG46uJCQpgPVk408zwU9LN77sv+A+dU=; b=aSWOajSTL5C7tHElvUOLzpB4vg gzd/5CYDJUZeFabh/W2LPGAlJxLKC6Sb64thpkF35ucYVuSWYFDXIZiMWIfC7KRhoFwh2WUoC5bV8 P+woOB5s/vjsw/G4mwScLVgaU; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:47364 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gcbIq-0004pC-QH; Thu, 27 Dec 2018 13:26:45 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/5] Simplify gdbpy_stop_recording Date: Thu, 27 Dec 2018 12:26:35 -0700 Message-Id: <20181227192637.17862-4-tom@tromey.com> In-Reply-To: <20181227192637.17862-1-tom@tromey.com> References: <20181227192637.17862-1-tom@tromey.com> This simplifies gdbpy_stop_recording, by having it use Py_RETURN_NONE rather than writing it out manually, and by usin the idiomatic GDB_PY_HANDLE_EXCEPTION. 2018-12-27 Tom Tromey * python/py-record.c (gdbpy_stop_recording): Use Py_RETURN_NONE. --- gdb/ChangeLog | 4 ++++ gdb/python/py-record.c | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/python/py-record.c b/gdb/python/py-record.c index b203786473..4b5de40f3e 100644 --- a/gdb/python/py-record.c +++ b/gdb/python/py-record.c @@ -638,19 +638,15 @@ gdbpy_current_recording (PyObject *self, PyObject *args) PyObject * gdbpy_stop_recording (PyObject *self, PyObject *args) { - PyObject *ret = NULL; - TRY { record_stop (0); - ret = Py_None; - Py_INCREF (Py_None); } CATCH (except, RETURN_MASK_ALL) { - gdbpy_convert_exception (except); + GDB_PY_HANDLE_EXCEPTION (except); } END_CATCH - return ret; + Py_RETURN_NONE; }