From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97331 invoked by alias); 22 Jun 2016 18:43:14 -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 97321 invoked by uid 89); 22 Jun 2016 18:43:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gproxy9-pub.mail.unifiedlayer.com Received: from gproxy9-pub.mail.unifiedlayer.com (HELO gproxy9-pub.mail.unifiedlayer.com) (69.89.20.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 22 Jun 2016 18:43:03 +0000 Received: (qmail 2840 invoked by uid 0); 22 Jun 2016 18:43:00 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy9.mail.unifiedlayer.com with SMTP; 22 Jun 2016 18:43:00 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id 9uiu1t00a2f2jeq01uixAU; Wed, 22 Jun 2016 12:42:59 -0600 X-Authority-Analysis: v=2.1 cv=OPe0g0qB 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=PnD2wP_eR3oA:10 a=7XZj0uCbPdcA:10 a=pD_ry4oyNxEA:10 a=pGLkceISAAAA:8 a=zstS-IiYAAAA:8 a=qhodq9QpZUyfAFeA_mEA:9 a=6kGIvZw6iX1k4Y-7sg4_:22 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from [75.171.172.174] (port=44870 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bFn71-0006DZ-FO; Wed, 22 Jun 2016 12:42:55 -0600 From: Tom Tromey To: Yao Qi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] PR python/18565 - make Frame.function work for inline frames References: <1466439050-11330-1-git-send-email-tom@tromey.com> <86ziqfq6sz.fsf@gmail.com> Date: Wed, 22 Jun 2016 18:43:00 -0000 In-Reply-To: <86ziqfq6sz.fsf@gmail.com> (Yao Qi's message of "Tue, 21 Jun 2016 09:34:20 +0100") Message-ID: <8737o5kqtv.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 75.171.172.174 authed with tom+tromey.com} X-Exim-ID: 1bFn71-0006DZ-FO X-Source-Sender: (pokyo) [75.171.172.174]:44870 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-06/txt/msg00370.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> Tom Tromey writes: >> TRY >> { >> + char *funname; >> + enum language funlang; >> + >> FRAPY_REQUIRE_VALID (self, frame); >> >> - sym = find_pc_function (get_frame_address_in_block (frame)); >> + find_frame_funname (frame, &funname, &funlang, &sym); >> + xfree (funname); >> } >> CATCH (except, RETURN_MASK_ALL) >> { Yao> Call xfree in CATCH block? Otherwise, patch is good to me. I looked at this. I think it's probably better as-is. My reasoning is that "funname" is initialized by the call to find_frame_funname and isn't otherwise used. So, putting the free where it appears now means that there is no gap between initialization and free. On the other hand if it is moved into the catch, then there have to be two frees, one in the catch and one afterward. So if it's ok with you, I'm inclined to leave it as-is. Another option would be to change find_frame_funname to allow a NULL argument here. Then this free would not be needed at all. Let me know what you think. Tom