Fix value label ranges resolution (#1572)
There was a bug how value labels were resolved, which caused some DWARF expressions not be transformed, e.g. those are in the registers. * Implements FIXME in expression.rs * Move TargetIsa from CompiledExpression structure * Fix expression format for GDB * Add tests for parsing * Proper logic in ValueLabelRangesBuilder::process_label * Tests for ValueLabelRangesBuilder * Refactor build_with_locals to return Iterator instead of Vec<_> * Misc comments and magical numbers
This commit is contained in:
@@ -228,19 +228,16 @@ fn generate_vars(
|
||||
};
|
||||
|
||||
let loc_list_id = {
|
||||
let endian = gimli::RunTimeEndian::Little;
|
||||
|
||||
let expr = CompiledExpression::from_label(*label, isa);
|
||||
let mut locs = Vec::new();
|
||||
for (begin, length, data) in
|
||||
expr.build_with_locals(scope_ranges, addr_tr, Some(frame_info), endian)?
|
||||
{
|
||||
locs.push(write::Location::StartLength {
|
||||
begin,
|
||||
length,
|
||||
data,
|
||||
});
|
||||
}
|
||||
let locs = CompiledExpression::from_label(*label)
|
||||
.build_with_locals(scope_ranges, addr_tr, Some(frame_info), isa)
|
||||
.map(|i| {
|
||||
i.map(|(begin, length, data)| write::Location::StartLength {
|
||||
begin,
|
||||
length,
|
||||
data,
|
||||
})
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
unit.locations.add(write::LocationList(locs))
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user