From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113788 invoked by alias); 25 Jul 2016 10:23:49 -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 113774 invoked by uid 89); 25 Jul 2016 10:23:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 Jul 2016 10:23:33 +0000 Received: by mail-oi0-f49.google.com with SMTP id w18so245560229oiw.3 for ; Mon, 25 Jul 2016 03:23:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0MDdPLC3Hbcj8NS56rgqwRBnS+adpnvePpFQqU6EbUk=; b=nN1YHYIYfATa038C4Q9TGTeIqHBO0PR8ChtUuI+PMgadconPzBO8wAQo/liH8OB8Od 8A5wIR4glijXuAEIP7jC38apFJUKnnYhS4jSMXpMDaq/MlcKkhUQEPHb6hhzVPlYeHmk xm41dZ/tjhY56Yvduo69V6M06wnGbOjcQ87YYfVf98PyU3t/MCiycekxXSeVkYvyXFWY r98SmRQzHtCPEg3RqBd3O/fhXBxUokj2a4KcPujPyuP2e5UaS0LDGxQOb7J4PginrSTb npA43IFfImBiNl2pxERVCY9Z8164j3uTTM/Sb91DcJNKtRTC56qQfr16Ue/+s+ZLoroE UmXg== X-Gm-Message-State: AEkooutWOHRDiMzxVn4MrWMixWk9wZDxz6fIeQQ3LUtXBkPkiCm7xYwzhkITV5Usosv5Q8jZ6v6zEEI2m/QCWA== X-Received: by 10.157.12.219 with SMTP id o27mr8415076otd.103.1469442211014; Mon, 25 Jul 2016 03:23:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.66.8 with HTTP; Mon, 25 Jul 2016 03:23:30 -0700 (PDT) In-Reply-To: <8737o5kqtv.fsf@tromey.com> References: <1466439050-11330-1-git-send-email-tom@tromey.com> <86ziqfq6sz.fsf@gmail.com> <8737o5kqtv.fsf@tromey.com> From: Yao Qi Date: Mon, 25 Jul 2016 10:23:00 -0000 Message-ID: Subject: Re: [RFA] PR python/18565 - make Frame.function work for inline frames To: Tom Tromey Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00322.txt.bz2 Sorry, I missed this mail, On Wed, Jun 22, 2016 at 7:42 PM, Tom Tromey wrote: >>>>>> "Yao" =3D=3D Yao Qi writes: > > Yao> Tom Tromey writes: >>> TRY >>> { >>> + char *funname; >>> + enum language funlang; >>> + >>> FRAPY_REQUIRE_VALID (self, frame); >>> >>> - sym =3D 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. > The reason I suggested that way is that the exception may be thrown out in find_frame_funname after the memory is allocated for funname, so we need xfree in CATCH, and also need xfree afterwards. --=20 Yao (=E9=BD=90=E5=B0=A7)