This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Eliminate -var-create error for optzd ptr to struct
- From: Don Breazeal <donb at codesourcery dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 4 Apr 2016 10:16:22 -0700
- Subject: Re: [PATCH] Eliminate -var-create error for optzd ptr to struct
- Authentication-results: sourceware.org; auth=none
- References: <1459526505-19291-1-git-send-email-donb at codesourcery dot com> <86pou5pseh dot fsf at gmail dot com>
On 4/4/2016 3:41 AM, Yao Qi wrote:
> Don Breazeal <donb@codesourcery.com> 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