This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: error reading variable: value has been optimized out
- From: Tom Tromey <tromey at redhat dot com>
- To: "Andrew Burgess" <aburgess at broadcom dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>, "Jan Kratochvil" <jan dot kratochvil at redhat dot com>
- Date: Wed, 12 Sep 2012 11:29:59 -0600
- Subject: Re: PATCH: error reading variable: value has been optimized out
- References: <50376F3B.1080407@broadcom.com> <20120826171840.GA21205@host2.jankratochvil.net> <504092C0.2000602@broadcom.com>
>>>>> "Andrew" == Andrew Burgess <aburgess@broadcom.com> writes:
Andrew> (3) Structures the size of two registers split over two
Andrew> registers using dwarf piece information.
Andrew> (4) Values the size of a single register split over two
Andrew> registers using dwarf piece information to describe the
Andrew> location.
Andrew> Cases (3) and (4) are not fixed by my original patch, and fail
Andrew> for a different reason. I could remove these from the test, but
Andrew> I believe the tests are reasonable, or at least not totally
Andrew> crazy, so I'm reluctant to just delete them. I could just
Andrew> commit the test with these two examples marked as known failing
Andrew> .... or I could fix them :)
Andrew> The problem is this,
Andrew> - In dwarf2loc.c:dwarf_evaluate_loc_desc_full we create the
Andrew> computed value from the pieced location information.
Andrew> - In dwarf2loc.c:read_pieced_value we spot that some of the
Andrew> registers are missing and mark the computed value as optimized
Andrew> out.
This scenario seems odd to me. I think what it means is that the
compiler declares an object as being split between two registers -- but
then also knows that one of the registers is not in fact available.
Does any compiler actually do this?
If it is just a theoretical problem I think we can just declare it
unsupported; and, if we do see it, try reporting it as a compiler bug
first. After all, the compiler could just emit an empty piece instead.
Tom