From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4405 invoked by alias); 20 Nov 2016 20:42:09 -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 3524 invoked by uid 89); 20 Nov 2016 20:42:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=locationh, blockh, py-cmd.c, UD:location.h X-HELO: gproxy6-pub.mail.unifiedlayer.com Received: from gproxy6-pub.mail.unifiedlayer.com (HELO gproxy6-pub.mail.unifiedlayer.com) (67.222.39.168) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Sun, 20 Nov 2016 20:41:47 +0000 Received: (qmail 10440 invoked by uid 0); 20 Nov 2016 20:41:45 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy6.mail.unifiedlayer.com with SMTP; 20 Nov 2016 20:41:45 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id ALhi1u0082f2jeq01Lhl93; Sun, 20 Nov 2016 13:41:45 -0700 X-Authority-Analysis: v=2.1 cv=K/+xQUmI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=L24OOQBejmoA:10 a=zstS-IiYAAAA:8 a=zNZUpIsGeivdbQ5aYBcA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:40590 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1c8Yvm-0005f5-1Z; Sun, 20 Nov 2016 13:41:42 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 04/13] Use gdbpy_ref in bpfinishpy_out_of_scope Date: Sun, 20 Nov 2016 20:42:00 -0000 Message-Id: <1479674496-14000-5-git-send-email-tom@tromey.com> In-Reply-To: <1479674496-14000-1-git-send-email-tom@tromey.com> References: <1479674496-14000-1-git-send-email-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1c8Yvm-0005f5-1Z X-Source-Sender: 174-16-143-211.hlrn.qwest.net (bapiya.Home) [174.16.143.211]:40590 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-11/txt/msg00589.txt.bz2 This changes bpfinishpy_out_of_scope to use gdbpy_ref. 2016-11-20 Tom Tromey * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use gdbpy_ref. --- gdb/ChangeLog | 5 +++++ gdb/python/py-finishbreakpoint.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c4a1f71..83ad836 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-11-20 Tom Tromey + * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use + gdbpy_ref. + +2016-11-20 Tom Tromey + * python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref. Remove extra incref. (cmdpy_completer_handle_brkchars, cmdpy_completer, cmdpy_init): diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index fdac696..391e735 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -30,6 +30,7 @@ #include "inferior.h" #include "block.h" #include "location.h" +#include "py-ref.h" /* Function that is called when a Python finish bp is found out of scope. */ static char * const outofscope_func = "out_of_scope"; @@ -337,12 +338,10 @@ bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj) if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled && PyObject_HasAttrString (py_obj, outofscope_func)) { - PyObject *meth_result; - - meth_result = PyObject_CallMethod (py_obj, outofscope_func, NULL); + gdbpy_ref meth_result (PyObject_CallMethod (py_obj, outofscope_func, + NULL)); if (meth_result == NULL) gdbpy_print_stack (); - Py_XDECREF (meth_result); } delete_breakpoint (bpfinish_obj->py_bp.bp); -- 2.7.4