From: Pedro Alves <palves@redhat.com>
To: Don Breazeal <donb@codesourcery.com>,
gdb-patches@sourceware.org, qiyaoltc@gmail.com
Subject: Re: [PATCH] Eliminate -var-create error for optzd ptr to struct
Date: Tue, 05 Apr 2016 19:00:00 -0000 [thread overview]
Message-ID: <57040B42.1040608@redhat.com> (raw)
In-Reply-To: <1459882257-7029-1-git-send-email-donb@codesourcery.com>
On 04/05/2016 07:50 PM, Don Breazeal wrote:
> Hi Yao,
>
> On 4/5/2016 5:52 AM, Yao Qi wrote:
>> Don Breazeal <donb@codesourcery.com> writes:
>
>>> + CATCH (ex, RETURN_MASK_ERROR)
>>> + {
>>> + /* If we get an error, assume the value is not optimized out. */
>>> + return 0;
>>
>> Why don't we fall back to checking value->optimized_out below? Some
>> bits/pieces of value are optimized out, but reading the rest of
>> bits/piece may trigger the memory error. In this case, the value is
>> optimized out too. We can do this...
>>
>> TRY
>> {
>> value_fetch_lazy (value);
>> }
>> CATCH (ex, RETURN_MASK_ERROR)
>> {
>> /* Fall back to checking value->optimized_out. */
>> }
>> END_CATCH
>>
>> What do you think?
>
> Of course, that makes more sense, thanks.
>
>> Note that, after this patch, value_optimized_out will no longer throw
>> exceptions, some TRY/CATCH in value_optimized_out's callers can be
>> removed, such as gdbscm_value_optimized_out_p and
>> valpy_get_is_optimized_out. This can be done in a follow-up patch.
>
> I've done a more thorough audit of the call sites for value_optimized_out
> than I did previously, and the only places where an enclosing TRY/CATCH can
> be removed are the two you name. There is one other place where it is
> called inside a TRY/CATCH, but there are other functions that could throw
> errors called there as well.
>
> I will create a follow-up patch.
>
> I changed this patch as you suggest above, as well as changing
> RETURN_MASK_ERROR to RETURN_MASK_ALL. The TRY/CATCH blocks that are
> going to be removed use RETURN_MASK_ALL, and I thought that this patch
> should maintain the same level of coverage.
Please don't. A RETURN_MASK_ALL swallows Ctrl-C/QUIT, and that's almost
always a bug. The cases you mention translate a QUIT to a python/scheme
exception, which is not the same as just swallowing the exception.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-04-05 19:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <861t6knro9.fsf@gmail.com>
2016-04-05 18:51 ` Don Breazeal
2016-04-05 19:00 ` Pedro Alves [this message]
2016-04-05 20:39 ` Don Breazeal
2016-04-06 9:05 ` Yao Qi
2016-04-06 21:41 ` Don Breazeal
2016-04-06 22:24 ` Pedro Alves
2016-04-07 14:12 ` Yao Qi
[not found] <1456273154-28629-1-git-send-email-donb@codesourcery.com>
2016-02-24 1:14 ` Luis Machado
2016-02-24 16:31 ` Don Breazeal
2016-02-25 12:22 ` Pedro Alves
2016-03-29 12:01 ` Yao Qi
2016-03-29 17:14 ` Don Breazeal
2016-03-30 14:35 ` Yao Qi
2016-04-01 16:01 ` Don Breazeal
2016-04-04 10:42 ` Yao Qi
2016-04-04 17:16 ` Don Breazeal
2016-04-04 21:28 ` Don Breazeal
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=57040B42.1040608@redhat.com \
--to=palves@redhat.com \
--cc=donb@codesourcery.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