Have you been following my discussions with Jim about how
DW_AT_location should be supported? I didn't just ask you to wait for
the LOC_COMPUTED patch out of sheer pique. If you're not using that
mechanism, then you're defeating the whole purpose it was implemented
for.
For instance, a good sized chunk of code you delete in the patch below
is no longer there. Be careful updating, since you copied that deleted
code to new functions; it shouldn't be there either.
Basically, location lists should be represented as LOC_COMPUTED
symbols; the LOC_COMPUTED lookup mechanism should be updated to accept
a PC when computing the location.
The entire thing will be worlds
simpler than all the work you did below, and a heck of a lot less
fragile. You just need to parse the location lists, store them in the
location baton, and select a list to evaluate in dwarf2loc.c. If
there's no list entry for $pc, that's where you return optimized-out;
it might take another little change to accept an optimized-out result
there. If there is a list entry you evaluate it just like presently.