From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47164 invoked by alias); 6 Apr 2016 21:41:43 -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 47153 invoked by uid 89); 6 Apr 2016 21:41:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=shakes, light X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Apr 2016 21:41:32 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1anvCc-0000dK-Sc from Don_Breazeal@mentor.com ; Wed, 06 Apr 2016 14:41:30 -0700 Received: from [172.30.4.120] (147.34.91.1) by SVR-ORW-FEM-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 6 Apr 2016 14:41:30 -0700 Subject: Re: [PATCH] Eliminate -var-create error for optzd ptr to struct To: Yao Qi References: <1459888769-18875-1-git-send-email-donb@codesourcery.com> <86lh4rm7kq.fsf@gmail.com> CC: "gdb-patches@sourceware.org" , "palves@redhat.com" From: Don Breazeal Message-ID: <5705828A.3030708@codesourcery.com> Date: Wed, 06 Apr 2016 21:41:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <86lh4rm7kq.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00141.txt.bz2 On 4/6/2016 2:04 AM, Yao Qi wrote: > Don Breazeal writes: > >>> 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. >> >> Patch below changes that back. Pedro, thanks for clarifying. >> > > No, it doesn't. > >> @@ -1433,7 +1434,17 @@ value_optimized_out (struct value *value) >> /* We can only know if a value is optimized out once we have tried to >> fetch it. */ >> if (VEC_empty (range_s, value->optimized_out) && value->lazy) >> - value_fetch_lazy (value); >> + { >> + TRY >> + { >> + value_fetch_lazy (value); >> + } >> + CATCH (ex, RETURN_MASK_ALL) > > It should be RETURN_MASK_ERROR. Sorry about that. /me shakes head at self for goofing up the easy stuff. > >> + { >> + /* Fall back to checking value->optimized_out. */ >> + } >> + END_CATCH >> + } > > Otherwise, patch is good to me. > Thanks Yao. This is now corrected and pushed in. Question: in light of Pedro's comments regarding gdbscm_value_optimized_out_p and valpy_get_is_optimized_out: > 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. Would you still like for me to follow up with a patch to remove the TRY/CATCH blocks around the calls to value_optimized_out in those two functions? Or do we want to leave it as-is so that the QUIT handling remains unchanged? Thanks --Don