[Lldb-commits] [PATCH] D17449: Handle the case when a variable is only valid in part of the enclosing scope

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 22 10:23:09 PST 2016

clayborg added a comment.

I would rather do this by modifying the expression locations if at all possible. I would like to not having to modify each variable to contain a RangeList as this is extra data per variable. I would be fine if we just add a new enumeration to the DWARFExpression like StartScopeLocationList which is the same as "RegularLocationList". The contents would be the same (start address + end address followed by location expression block), but it would mean that the locations indicate that the variable is in scope (instead of just not available). Then we just need to modify Variable::IsInScope() to check what it did before, and if the DWARFExpression is StartScopeLocationList, just make sure we have a location that contains the current address. Does that sound acceptable? I am also OK with modifying the DWARFExpression class to be able to return an enumeration when the DWARFExpression is evaluated so it can return things like:


Then RegularLocationList would return eDWARFExpressionVariableNotAvailable when there is no location that the variable is available, and StartScopeLocationList would return eDWARFExpressionOutOfScope.


More information about the lldb-commits mailing list