This function does a _lot_ of different things:
- Parses a DIE,
- Builds an ExpressionList
- Figures out lifetime of variable
- Remaps addresses for debug maps
- Handles external variables
- Figures out scope of variables
A lot of this functionality is coded in a complex nest of conditions, variables
that are declared and then initialized much later, variables that are updated in
multiple code paths. All of this makes the code really hard to follow.
This commit attempts to improve the state of things by factoring out (3), adding
documentation on how the expression list is built, and by reducing the scope of
variables.
FWIW all this code was just moved outside the main function.