covoar: wrong symbol length in coverage map

This commit is contained in:
Jiri Gaisler
2019-01-25 16:40:29 +01:00
parent dd6a10dfe6
commit c553ccdd1e
2 changed files with 2 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ namespace Coverage {
for (auto& func : cu.get_functions()) {
if (func.has_machine_code() && (!func.is_inlined() || func.is_external())) {
createCoverageMap (cu.name(), func.name(),
func.pc_low(), func.pc_high());
func.pc_low(), func.pc_high() - 1);
}
}
}

View File

@@ -36,7 +36,7 @@ namespace Coverage {
uint32_t lowAddress = coverageMap.getFirstLowAddress();
uint32_t size = coverageMap.getSize();
uint32_t highAddress = lowAddress + size;
uint32_t highAddress = lowAddress + size - 1;
// If there are NOT already saved instructions, save them.
SymbolInformation* symbolInfo = SymbolsToAnalyze->find( symbolName );