From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117348 invoked by alias); 4 Apr 2016 17:16:40 -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 117335 invoked by uid 89); 4 Apr 2016 17:16:39 -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= 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; Mon, 04 Apr 2016 17:16:29 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1an871-0004jA-8O from Don_Breazeal@mentor.com ; Mon, 04 Apr 2016 10:16:27 -0700 Received: from [172.30.4.120] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 4 Apr 2016 10:16:27 -0700 Subject: Re: [PATCH] Eliminate -var-create error for optzd ptr to struct To: Yao Qi References: <1459526505-19291-1-git-send-email-donb@codesourcery.com> <86pou5pseh.fsf@gmail.com> CC: "gdb-patches@sourceware.org" From: Don Breazeal Message-ID: <5702A166.6090701@codesourcery.com> Date: Mon, 04 Apr 2016 17:16: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: <86pou5pseh.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00046.txt.bz2 On 4/4/2016 3:41 AM, Yao Qi wrote: > Don Breazeal writes: > >> Note that we if value_optimized_out throws an error we just assume >> the value is not optimized out. We let value_rtti_indirect_type >> handle any errors, and don't try to duplicate its error handling. > > I am wondering why does value_optimized_out have to throw an error? > Can't we catch the error in value_optimized_out thrown by > value_fetch_lazy? > > I am not very sure on this idea, but I searched the archive, and didn't > find anything say we can't do that. > I looked briefly at all the call sites for value_optimized_out. It looks like if value_optimized_out were to just return 'false' when it got a memory error, the result in most cases would be that a subsequent memory read would throw an error. It might be that this could prevent a scenario similar to the -var-create error elsewhere in GDB, but there wasn't anything obvious in my quick scan. I'll change the patch accordingly and run the testsuite. --Don