But anyway, all this could be handled much better nowadays using Dwarf
2 CFA and location lists. I've been saying that for years, but it
hasn't happened yet. Andrew has the CFI done now (I think?), and
Daniel B. has submitted a patch for location expressions (but not
location lists, tho they would be easy to add), but it's awaiting
revision while he works on law school.
I actually have the revisions necessary to do location lists, but it
makes work of the location expression lists anyway (We just store range
list mapping ranges to locexpr batons). It's literally nothing but a
layer over that code that picks out the right baton(s) for the given
pc, and calls the location functions for each baton.