From: Tom Tromey <tom@tromey.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] PR python/18565 - make Frame.function work for inline frames
Date: Wed, 22 Jun 2016 18:43:00 -0000 [thread overview]
Message-ID: <8737o5kqtv.fsf@tromey.com> (raw)
In-Reply-To: <86ziqfq6sz.fsf@gmail.com> (Yao Qi's message of "Tue, 21 Jun 2016 09:34:20 +0100")
>>>>> "Yao" == Yao Qi <qiyaoltc@gmail.com> writes:
Yao> Tom Tromey <tom@tromey.com> 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
next prev parent reply other threads:[~2016-06-22 18:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 16:11 Tom Tromey
[not found] ` <86ziqfq6sz.fsf@gmail.com>
2016-06-22 18:43 ` Tom Tromey [this message]
2016-07-25 10:23 ` Yao Qi
2016-07-25 11:04 ` Pedro Alves
2016-07-25 15:01 ` Tom Tromey
2016-07-26 11:14 ` Pedro Alves
2016-07-26 13:18 ` Tom Tromey
2016-07-26 14:33 ` Pedro Alves
2016-08-03 8:15 ` Yao Qi
2016-08-03 15:14 ` Tom Tromey
2016-08-03 17:57 ` Pedro Alves
2016-08-03 8:07 ` Yao Qi
2016-08-03 11:35 ` Pedro Alves
2016-08-03 13:15 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8737o5kqtv.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox