<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 6, 2021 at 10:56 AM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">looks ok, it's a lot to try to process though.<br>
<br>
In a future patch it would be good to provide more useful names, I<br>
don't know what 'ha' and 'la' mean, if anything. at least 'a' I<br>
understand to be an address.<br></blockquote><div><br></div><div><br></div><div>high and low address which probably is my fault from 10+ years ago. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Also, the typedef with appending _t at the end should be removed, _t<br>
is reserved by POSIX.<br></blockquote><div><br></div><div>Good catch although I do like _t. :( </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
And I don't know why the _m is being appended, I guess it is denoted<br>
member variables? I'm used to seeing it as a prefix rather than a<br>
suffix, if it gets used at all. A few more C++ issues to add to the<br>
backlog.<br></blockquote><div><br></div><div>This is also from the earliest days of this code. Looks like it didn't catch on. </div><div>I do tend to prefer suffixes over prefixes but if it isn't common, OK. </div><div><br></div><div>Probably easy enough to do a grep and then search and replace them all</div><div>in one pass. Should not change spacing and should be harmless.</div><div><br></div><div>--joel</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Mon, Apr 5, 2021 at 1:25 PM Alex White <<a href="mailto:alex.white@oarcorp.com" target="_blank">alex.white@oarcorp.com</a>> wrote:<br>
><br>
> This changes the way covoar organizes the symbols. Instead of treating<br>
> all symbols as one set, covoar is now aware of multiple symbol sets and<br>
> tracks statistics for each set. It now also generates reports for each<br>
> symbol set.<br>
><br>
> This change relieves the caller of covoar of the reponsibility of<br>
> managing the symbol sets. As a result, covoar can minimize the work<br>
> done for each symbol set, yielding a significant speedup.<br>
><br>
> Updates #4374<br>
> ---<br>
> tester/covoar/DesiredSymbols.cc | 465 +++++++++++++++++---------------<br>
> tester/covoar/DesiredSymbols.h | 98 +++++--<br>
> tester/covoar/ReportsBase.cc | 181 +++++++------<br>
> tester/covoar/ReportsBase.h | 40 ++-<br>
> tester/covoar/ReportsHtml.cc | 62 +++--<br>
> tester/covoar/ReportsHtml.h | 13 +-<br>
> tester/covoar/ReportsText.cc | 66 ++---<br>
> tester/covoar/ReportsText.h | 13 +-<br>
> tester/covoar/covoar.cc | 6 +-<br>
> 9 files changed, 542 insertions(+), 402 deletions(-)<br>
><br>
> diff --git a/tester/covoar/DesiredSymbols.cc b/tester/covoar/DesiredSymbols.cc<br>
> index ffc4f86..2866dbe 100644<br>
> --- a/tester/covoar/DesiredSymbols.cc<br>
> +++ b/tester/covoar/DesiredSymbols.cc<br>
> @@ -37,6 +37,11 @@ namespace Coverage {<br>
> {<br>
> }<br>
><br>
> + const DesiredSymbols::symbolSet_t& DesiredSymbols::allSymbols() const<br>
> + {<br>
> + return set;<br>
> + }<br>
> +<br>
> void DesiredSymbols::load(<br>
> const std::string& symbolsSet,<br>
> const std::string& buildTarget,<br>
> @@ -44,8 +49,6 @@ namespace Coverage {<br>
> bool verbose<br>
> )<br>
> {<br>
> - rld::files::cache cache;<br>
> -<br>
> //<br>
> // Load the INI file looking for a top level:<br>
> //<br>
> @@ -60,61 +63,61 @@ namespace Coverage {<br>
> // [B]<br>
> // libraries = @BUILD-PREFIX@/c/@BSP@/B/libB.a<br>
> //<br>
> - try {<br>
> - cache.open();<br>
> + rld::config::config config;<br>
><br>
> - rld::config::config config;<br>
> + if (verbose)<br>
> + std::cerr << "Loading symbol sets: " << symbolsSet << std::endl;<br>
><br>
> - if (verbose)<br>
> - std::cerr << "Loading symbol sets: " << symbolsSet << std::endl;<br>
> + config.load (symbolsSet);<br>
><br>
> - config.load (symbolsSet);<br>
> + const rld::config::section& sym_section = config.get_section("symbol-sets");<br>
><br>
> - const rld::config::section& sym_section = config.get_section("symbol-sets");<br>
> + rld::strings sets;<br>
> + rld::config::parse_items (sym_section, "sets", sets, true);<br>
><br>
> - rld::strings sets;<br>
> - rld::config::parse_items (sym_section, "sets", sets, true);<br>
> + // Load the symbols for each set specified in the config file.<br>
> + for (const auto& setName : sets) {<br>
> + rld::files::cache cache;<br>
> + cache.open();<br>
><br>
> - for (const std::string set : sets) {<br>
> + if (verbose)<br>
> + std::cerr << "Loading symbols for set: " << setName << std::endl;<br>
> + const rld::config::section& set_section = config.get_section(setName);<br>
> + rld::strings libs;<br>
> + rld::config::parse_items (set_section, "libraries", libs, true);<br>
> + for (std::string lib : libs) {<br>
> + lib = rld::find_replace(lib, "@BUILD-TARGET@", buildTarget);<br>
> + lib = rld::find_replace(lib, "@BSP@", buildBSP);<br>
> if (verbose)<br>
> - std::cerr << " Symbol set: " << set << std::endl;<br>
> - const rld::config::section& set_section = config.get_section(set);<br>
> - rld::strings libs;<br>
> - rld::config::parse_items (set_section, "libraries", libs, true);<br>
> - for (std::string lib : libs) {<br>
> - lib = rld::find_replace(lib, "@BUILD-TARGET@", buildTarget);<br>
> - lib = rld::find_replace(lib, "@BSP@", buildBSP);<br>
> - if (verbose)<br>
> - std::cerr << " Loading library: " << lib << std::endl;<br>
> - cache.add(lib);<br>
> - }<br>
> + std::cerr << " Loading library: " << lib << std::endl;<br>
> + cache.add(lib);<br>
> }<br>
><br>
> rld::symbols::table symbols;<br>
><br>
> cache.load_symbols (symbols, true);<br>
><br>
> + // Populate the symbol maps with all global symbols.<br>
> for (auto& kv : symbols.globals()) {<br>
> const rld::symbols::symbol& sym = *(kv.second);<br>
> - if (sym.type() == sym.st_func)<br>
> + if (sym.type() == sym.st_func) {<br>
> set[<a href="http://sym.name" rel="noreferrer" target="_blank">sym.name</a>()] = *(new SymbolInformation);<br>
> + setNamesToSymbols[setName].push_back(<a href="http://sym.name" rel="noreferrer" target="_blank">sym.name</a>());<br>
> + }<br>
> }<br>
> + // Populate the symbol maps with all weak symbols.<br>
> for (auto& kv : symbols.weaks()) {<br>
> const rld::symbols::symbol& sym = *(kv.second);<br>
> - if (sym.type() == sym.st_func)<br>
> + if (sym.type() == sym.st_func) {<br>
> set[<a href="http://sym.name" rel="noreferrer" target="_blank">sym.name</a>()] = *(new SymbolInformation);<br>
> + setNamesToSymbols[setName].push_back(<a href="http://sym.name" rel="noreferrer" target="_blank">sym.name</a>());<br>
> + }<br>
> }<br>
> - } catch (...) {<br>
> - cache.close();<br>
> - throw;<br>
> }<br>
> -<br>
> - cache.close();<br>
> }<br>
><br>
> void DesiredSymbols::preprocess( void )<br>
> {<br>
> -<br>
> // Look at each symbol.<br>
> for (auto& s : SymbolsToAnalyze->set) {<br>
> // If the unified coverage map does not exist, the symbol was<br>
> @@ -135,48 +138,52 @@ namespace Coverage {<br>
><br>
> void DesiredSymbols::calculateStatistics( void )<br>
> {<br>
> - // Look at each symbol.<br>
> - for (auto& s : SymbolsToAnalyze->set) {<br>
> - // If the unified coverage map does not exist, the symbol was<br>
> - // never referenced by any executable. Just skip it.<br>
> - CoverageMapBase* theCoverageMap = s.second.unifiedCoverageMap;<br>
> - if (theCoverageMap)<br>
> - {<br>
> - // Increment the total sizeInBytes by the bytes in the symbol<br>
> - stats.sizeInBytes += s.second.stats.sizeInBytes;<br>
> -<br>
> - // Now scan through the coverage map of this symbol.<br>
> - uint32_t endAddress = s.second.stats.sizeInBytes - 1;<br>
> -<br>
> - for (uint32_t a = 0; a <= endAddress; ++a) {<br>
> - // If we are at the start of instruction increment<br>
> - // instruction type counters as needed.<br>
> - if ( theCoverageMap->isStartOfInstruction( a ) ) {<br>
> -<br>
> - stats.sizeInInstructions++;<br>
> - s.second.stats.sizeInInstructions++;<br>
> -<br>
> - if (!theCoverageMap->wasExecuted( a ) ) {<br>
> - stats.uncoveredInstructions++;<br>
> - s.second.stats.uncoveredInstructions++;<br>
> -<br>
> - if ( theCoverageMap->isBranch( a )) {<br>
> - stats.branchesNotExecuted++;<br>
> - s.second.stats.branchesNotExecuted++;<br>
> + // Look at each symbol set.<br>
> + for (const auto& kv : setNamesToSymbols) {<br>
> + // Look at each symbol.<br>
> + for (const auto& symbol : kv.second) {<br>
> + SymbolInformation& info = <a href="http://set.at" rel="noreferrer" target="_blank">set.at</a>(symbol);<br>
> +<br>
> + // If the unified coverage map does not exist, the symbol was<br>
> + // never referenced by any executable. Just skip it.<br>
> + CoverageMapBase* theCoverageMap = info.unifiedCoverageMap;<br>
> + if (theCoverageMap) {<br>
> + // Increment the total sizeInBytes by the bytes in the symbol<br>
> + stats[kv.first].sizeInBytes += info.stats.sizeInBytes;<br>
> +<br>
> + // Now scan through the coverage map of this symbol.<br>
> + uint32_t endAddress = info.stats.sizeInBytes - 1;<br>
> +<br>
> + for (uint32_t a = 0; a <= endAddress; ++a) {<br>
> + // If we are at the start of instruction increment<br>
> + // instruction type counters as needed.<br>
> + if ( theCoverageMap->isStartOfInstruction( a ) ) {<br>
> +<br>
> + stats[kv.first].sizeInInstructions++;<br>
> + info.stats.sizeInInstructions++;<br>
> +<br>
> + if (!theCoverageMap->wasExecuted( a ) ) {<br>
> + stats[kv.first].uncoveredInstructions++;<br>
> + info.stats.uncoveredInstructions++;<br>
> +<br>
> + if ( theCoverageMap->isBranch( a )) {<br>
> + stats[kv.first].branchesNotExecuted++;<br>
> + info.stats.branchesNotExecuted++;<br>
> + }<br>
> + } else if (theCoverageMap->isBranch( a )) {<br>
> + stats[kv.first].branchesExecuted++;<br>
> + info.stats.branchesExecuted++;<br>
> }<br>
> - } else if (theCoverageMap->isBranch( a )) {<br>
> - stats.branchesExecuted++;<br>
> - s.second.stats.branchesExecuted++;<br>
> }<br>
> - }<br>
><br>
> - if (!theCoverageMap->wasExecuted( a )) {<br>
> - stats.uncoveredBytes++;<br>
> - s.second.stats.uncoveredBytes++;<br>
> + if (!theCoverageMap->wasExecuted( a )) {<br>
> + stats[kv.first].uncoveredBytes++;<br>
> + info.stats.uncoveredBytes++;<br>
> + }<br>
> }<br>
> + } else {<br>
> + stats[kv.first].unreferencedSymbols++;<br>
> }<br>
> - } else {<br>
> - stats.unreferencedSymbols++;<br>
> }<br>
> }<br>
> }<br>
> @@ -184,152 +191,155 @@ namespace Coverage {<br>
><br>
> void DesiredSymbols::computeUncovered( void )<br>
> {<br>
> - // Look at each symbol.<br>
> - for (auto& s : SymbolsToAnalyze->set) {<br>
> - // If the unified coverage map does not exist, the symbol was<br>
> - // never referenced by any executable. Just skip it.<br>
> - CoverageMapBase* theCoverageMap = s.second.unifiedCoverageMap;<br>
> - if (theCoverageMap)<br>
> - {<br>
> - // Create containers for the symbol's uncovered ranges and branches.<br>
> - CoverageRanges* theRanges = new CoverageRanges();<br>
> - s.second.uncoveredRanges = theRanges;<br>
> - CoverageRanges* theBranches = new CoverageRanges();<br>
> - s.second.uncoveredBranches = theBranches;<br>
> -<br>
> - uint32_t a;<br>
> - uint32_t la;<br>
> - uint32_t ha;<br>
> - uint32_t endAddress;<br>
> - uint32_t count;<br>
> -<br>
> - // Mark NOPs as executed<br>
> - a = s.second.stats.sizeInBytes - 1;<br>
> - count = 0;<br>
> - while (a > 0) {<br>
> - if (theCoverageMap->isStartOfInstruction( a )) {<br>
> - break;<br>
> - }<br>
> -<br>
> - count++;<br>
> -<br>
> - if (theCoverageMap->isNop( a )) {<br>
> - for (la = a; la < (a + count); la++) {<br>
> - theCoverageMap->setWasExecuted( la );<br>
> + // Look at each symbol set.<br>
> + for (const auto& kv : setNamesToSymbols) {<br>
> + // Look at each symbol.<br>
> + for (const auto& symbol : kv.second) {<br>
> + SymbolInformation& info = <a href="http://set.at" rel="noreferrer" target="_blank">set.at</a>(symbol);<br>
> + // If the unified coverage map does not exist, the symbol was<br>
> + // never referenced by any executable. Just skip it.<br>
> + CoverageMapBase* theCoverageMap = info.unifiedCoverageMap;<br>
> + if (theCoverageMap) {<br>
> + // Create containers for the symbol's uncovered ranges and branches.<br>
> + CoverageRanges* theRanges = new CoverageRanges();<br>
> + info.uncoveredRanges = theRanges;<br>
> + CoverageRanges* theBranches = new CoverageRanges();<br>
> + info.uncoveredBranches = theBranches;<br>
> +<br>
> + uint32_t a;<br>
> + uint32_t la;<br>
> + uint32_t ha;<br>
> + uint32_t endAddress;<br>
> + uint32_t count;<br>
> +<br>
> + // Mark NOPs as executed<br>
> + a = info.stats.sizeInBytes - 1;<br>
> + count = 0;<br>
> + while (a > 0) {<br>
> + if (theCoverageMap->isStartOfInstruction( a )) {<br>
> + break;<br>
> }<br>
><br>
> - count = 0;<br>
> - }<br>
> + count++;<br>
><br>
> - a--;<br>
> - }<br>
> + if (theCoverageMap->isNop( a )) {<br>
> + for (la = a; la < (a + count); la++) {<br>
> + theCoverageMap->setWasExecuted( la );<br>
> + }<br>
><br>
> - endAddress = s.second.stats.sizeInBytes - 1;<br>
> - a = 0;<br>
> - while (a < endAddress) {<br>
> - if (!theCoverageMap->wasExecuted( a )) {<br>
> - a++;<br>
> - continue;<br>
> - }<br>
> + count = 0;<br>
> + }<br>
><br>
> - for (ha=a+1;<br>
> - ha <= endAddress && !theCoverageMap->isStartOfInstruction( ha );<br>
> - ha++)<br>
> - ;<br>
> - if ( ha >= endAddress )<br>
> - break;<br>
> -<br>
> - if (theCoverageMap->isNop( ha ))<br>
> - do {<br>
> - theCoverageMap->setWasExecuted( ha );<br>
> - ha++;<br>
> - if ( ha >= endAddress )<br>
> - break;<br>
> - } while ( !theCoverageMap->isStartOfInstruction( ha ) ||<br>
> - theCoverageMap->isNop( ha ) );<br>
> - a = ha;<br>
> - }<br>
> + a--;<br>
> + }<br>
><br>
> - // Now scan through the coverage map of this symbol.<br>
> - endAddress = s.second.stats.sizeInBytesWithoutNops - 1;<br>
> - a = 0;<br>
> - while (a <= endAddress) {<br>
> - // If an address was NOT executed, find consecutive unexecuted<br>
> - // addresses and add them to the uncovered ranges.<br>
> - if (!theCoverageMap->wasExecuted( a )) {<br>
> -<br>
> - la = a;<br>
> - count = 1;<br>
> - for (ha = a + 1;<br>
> - ha <= endAddress && !theCoverageMap->wasExecuted( ha );<br>
> - ha++)<br>
> - {<br>
> - if ( theCoverageMap->isStartOfInstruction( ha ) )<br>
> - count++;<br>
> + endAddress = info.stats.sizeInBytes - 1;<br>
> + a = 0;<br>
> + while (a < endAddress) {<br>
> + if (!theCoverageMap->wasExecuted( a )) {<br>
> + a++;<br>
> + continue;<br>
> }<br>
> - ha--;<br>
> -<br>
> - stats.uncoveredRanges++;<br>
> - s.second.stats.uncoveredRanges++;<br>
> - theRanges->add(<br>
> - s.second.baseAddress + la,<br>
> - s.second.baseAddress + ha,<br>
> - CoverageRanges::UNCOVERED_REASON_NOT_EXECUTED,<br>
> - count<br>
> - );<br>
> - a = ha + 1;<br>
> - }<br>
><br>
> - // If an address is a branch instruction, add any uncovered branches<br>
> - // to the uncoverd branches.<br>
> - else if (theCoverageMap->isBranch( a )) {<br>
> - la = a;<br>
> - for (ha = a + 1;<br>
> - ha <= endAddress && !theCoverageMap->isStartOfInstruction( ha );<br>
> - ha++)<br>
> + for (ha=a+1;<br>
> + ha <= endAddress && !theCoverageMap->isStartOfInstruction( ha );<br>
> + ha++)<br>
> ;<br>
> - ha--;<br>
> -<br>
> - if (theCoverageMap->wasAlwaysTaken( la )) {<br>
> - stats.branchesAlwaysTaken++;<br>
> - s.second.stats.branchesAlwaysTaken++;<br>
> - theBranches->add(<br>
> - s.second.baseAddress + la,<br>
> - s.second.baseAddress + ha,<br>
> - CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN,<br>
> - 1<br>
> + if ( ha >= endAddress )<br>
> + break;<br>
> +<br>
> + if (theCoverageMap->isNop( ha ))<br>
> + do {<br>
> + theCoverageMap->setWasExecuted( ha );<br>
> + ha++;<br>
> + if ( ha >= endAddress )<br>
> + break;<br>
> + } while ( !theCoverageMap->isStartOfInstruction( ha ) ||<br>
> + theCoverageMap->isNop( ha ) );<br>
> + a = ha;<br>
> + }<br>
> +<br>
> + // Now scan through the coverage map of this symbol.<br>
> + endAddress = info.stats.sizeInBytesWithoutNops - 1;<br>
> + a = 0;<br>
> + while (a <= endAddress) {<br>
> + // If an address was NOT executed, find consecutive unexecuted<br>
> + // addresses and add them to the uncovered ranges.<br>
> + if (!theCoverageMap->wasExecuted( a )) {<br>
> +<br>
> + la = a;<br>
> + count = 1;<br>
> + for (ha = a + 1;<br>
> + ha <= endAddress && !theCoverageMap->wasExecuted( ha );<br>
> + ha++)<br>
> + {<br>
> + if ( theCoverageMap->isStartOfInstruction( ha ) )<br>
> + count++;<br>
> + }<br>
> + ha--;<br>
> +<br>
> + stats[kv.first].uncoveredRanges++;<br>
> + info.stats.uncoveredRanges++;<br>
> + theRanges->add(<br>
> + info.baseAddress + la,<br>
> + info.baseAddress + ha,<br>
> + CoverageRanges::UNCOVERED_REASON_NOT_EXECUTED,<br>
> + count<br>
> );<br>
> - if (Verbose)<br>
> - std::cerr << "Branch always taken found in" << s.first<br>
> - << std::hex<br>
> - << " (0x" << s.second.baseAddress + la<br>
> - << " - 0x" << s.second.baseAddress + ha<br>
> - << ")"<br>
> - << std::dec<br>
> - << std::endl;<br>
> + a = ha + 1;<br>
> }<br>
> - else if (theCoverageMap->wasNeverTaken( la )) {<br>
> - stats.branchesNeverTaken++;<br>
> - s.second.stats.branchesNeverTaken++;<br>
> - theBranches->add(<br>
> - s.second.baseAddress + la,<br>
> - s.second.baseAddress + ha,<br>
> - CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN,<br>
> - 1<br>
> +<br>
> + // If an address is a branch instruction, add any uncovered branches<br>
> + // to the uncoverd branches.<br>
> + else if (theCoverageMap->isBranch( a )) {<br>
> + la = a;<br>
> + for (ha = a + 1;<br>
> + ha <= endAddress && !theCoverageMap->isStartOfInstruction( ha );<br>
> + ha++)<br>
> + ;<br>
> + ha--;<br>
> +<br>
> + if (theCoverageMap->wasAlwaysTaken( la )) {<br>
> + stats[kv.first].branchesAlwaysTaken++;<br>
> + info.stats.branchesAlwaysTaken++;<br>
> + theBranches->add(<br>
> + info.baseAddress + la,<br>
> + info.baseAddress + ha,<br>
> + CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN,<br>
> + 1<br>
> );<br>
> - if (Verbose)<br>
> - std::cerr << "Branch never taken found in " << s.first<br>
> - << std::hex<br>
> - << " (0x" << s.second.baseAddress + la<br>
> - << " - 0x" << s.second.baseAddress + ha<br>
> - << ")"<br>
> - << std::dec<br>
> - << std::endl;<br>
> + if (Verbose)<br>
> + std::cerr << "Branch always taken found in" << symbol<br>
> + << std::hex<br>
> + << " (0x" << info.baseAddress + la<br>
> + << " - 0x" << info.baseAddress + ha<br>
> + << ")"<br>
> + << std::dec<br>
> + << std::endl;<br>
> + }<br>
> + else if (theCoverageMap->wasNeverTaken( la )) {<br>
> + stats[kv.first].branchesNeverTaken++;<br>
> + info.stats.branchesNeverTaken++;<br>
> + theBranches->add(<br>
> + info.baseAddress + la,<br>
> + info.baseAddress + ha,<br>
> + CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN,<br>
> + 1<br>
> + );<br>
> + if (Verbose)<br>
> + std::cerr << "Branch never taken found in " << symbol<br>
> + << std::hex<br>
> + << " (0x" << info.baseAddress + la<br>
> + << " - 0x" << info.baseAddress + ha<br>
> + << ")"<br>
> + << std::dec<br>
> + << std::endl;<br>
> + }<br>
> + a = ha + 1;<br>
> }<br>
> - a = ha + 1;<br>
> + else<br>
> + a++;<br>
> }<br>
> - else<br>
> - a++;<br>
> }<br>
> }<br>
> }<br>
> @@ -460,30 +470,61 @@ namespace Coverage {<br>
> }<br>
> }<br>
><br>
> - uint32_t DesiredSymbols::getNumberBranchesAlwaysTaken( void ) const {<br>
> - return stats.branchesAlwaysTaken;<br>
> + uint32_t DesiredSymbols::getNumberBranchesAlwaysTaken(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).branchesAlwaysTaken;<br>
> };<br>
><br>
> - uint32_t DesiredSymbols::getNumberBranchesFound( void ) const {<br>
> - return (stats.branchesNotExecuted + stats.branchesExecuted);<br>
> + uint32_t DesiredSymbols::getNumberBranchesFound(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return (<br>
> + <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).branchesNotExecuted +<br>
> + <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).branchesExecuted<br>
> + );<br>
> };<br>
><br>
> - uint32_t DesiredSymbols::getNumberBranchesNeverTaken( void ) const {<br>
> - return stats.branchesNeverTaken;<br>
> + uint32_t DesiredSymbols::getNumberBranchesNeverTaken(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).branchesNeverTaken;<br>
> };<br>
><br>
> - uint32_t DesiredSymbols::getNumberBranchesNotExecuted( void ) const {<br>
> - return stats.branchesNotExecuted;<br>
> + uint32_t DesiredSymbols::getNumberBranchesNotExecuted(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).branchesNotExecuted;<br>
> };<br>
><br>
> - uint32_t DesiredSymbols::getNumberUncoveredRanges( void ) const {<br>
> - return stats.uncoveredRanges;<br>
> + uint32_t DesiredSymbols::getNumberUncoveredRanges(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).uncoveredRanges;<br>
> };<br>
><br>
> - uint32_t DesiredSymbols::getNumberUnreferencedSymbols( void ) const {<br>
> - return stats.unreferencedSymbols;<br>
> + uint32_t DesiredSymbols::getNumberUnreferencedSymbols(<br>
> + const std::string& symbolSetName<br>
> + ) const {<br>
> + return <a href="http://stats.at" rel="noreferrer" target="_blank">stats.at</a>(symbolSetName).unreferencedSymbols;<br>
> };<br>
><br>
> + std::vector<std::string> DesiredSymbols::getSetNames( void ) const {<br>
> + std::vector<std::string> setNames;<br>
> + for (const auto &kv : setNamesToSymbols) {<br>
> + setNames.push_back(kv.first);<br>
> + }<br>
> +<br>
> + return setNames;<br>
> + }<br>
> +<br>
> + const std::vector<std::string>& DesiredSymbols::getSymbolsForSet(<br>
> + const std::string& symbolSetName<br>
> + ) const<br>
> + {<br>
> + return setNamesToSymbols.at(symbolSetName);<br>
> + }<br>
> +<br>
> bool DesiredSymbols::isDesired (<br>
> const std::string& symbolName<br>
> ) const<br>
> diff --git a/tester/covoar/DesiredSymbols.h b/tester/covoar/DesiredSymbols.h<br>
> index 5cf96e9..5280d50 100644<br>
> --- a/tester/covoar/DesiredSymbols.h<br>
> +++ b/tester/covoar/DesiredSymbols.h<br>
> @@ -197,12 +197,6 @@ namespace Coverage {<br>
> */<br>
> typedef std::map<std::string, SymbolInformation> symbolSet_t;<br>
><br>
> - /*!<br>
> - * This variable contains a map of symbol sets for each<br>
> - * symbol in the system keyed on the symbol name.<br>
> - */<br>
> - symbolSet_t set;<br>
> -<br>
> /*!<br>
> * This method constructs a DesiredSymbols instance.<br>
> */<br>
> @@ -213,6 +207,11 @@ namespace Coverage {<br>
> */<br>
> ~DesiredSymbols();<br>
><br>
> + /*!<br>
> + * The set of all symbols.<br>
> + */<br>
> + const symbolSet_t& allSymbols() const;<br>
> +<br>
> /*!<br>
> * This method loops through the coverage map and<br>
> * calculates the statistics that have not already<br>
> @@ -262,51 +261,93 @@ namespace Coverage {<br>
><br>
> /*!<br>
> * This method returns the total number of branches always taken<br>
> - * for all analyzed symbols.<br>
> + * for all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of branches always taken<br>
> */<br>
> - uint32_t getNumberBranchesAlwaysTaken( void ) const;<br>
> + uint32_t getNumberBranchesAlwaysTaken(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns the total number of branches found for<br>
> - * all analyzed symbols.<br>
> + * all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of branches found<br>
> */<br>
> - uint32_t getNumberBranchesFound( void ) const;<br>
> + uint32_t getNumberBranchesFound(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns the total number of branches never taken<br>
> - * for all analyzed symbols.<br>
> + * for all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of branches never taken<br>
> */<br>
> - uint32_t getNumberBranchesNeverTaken( void ) const;<br>
> + uint32_t getNumberBranchesNeverTaken(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns the total number of branches not executed<br>
> - * for all analyzed symbols.<br>
> + * for all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of branches not executed<br>
> */<br>
> - uint32_t getNumberBranchesNotExecuted( void ) const;<br>
> + uint32_t getNumberBranchesNotExecuted(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns the total number of uncovered ranges<br>
> - * for all analyzed symbols.<br>
> + * for all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of uncovered ranges<br>
> */<br>
> - uint32_t getNumberUncoveredRanges( void ) const;<br>
> + uint32_t getNumberUncoveredRanges(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns the total number of unreferenced symbols<br>
> - * for all analyzed symbols.<br>
> + * for all analyzed symbols in a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> *<br>
> * @return Returns the total number of unreferenced symbols<br>
> */<br>
> - uint32_t getNumberUnreferencedSymbols( void ) const;<br>
> + uint32_t getNumberUnreferencedSymbols(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
> +<br>
> + /*!<br>
> + * This method returns all symbol set names.<br>
> + *<br>
> + * @return Returns all symbol set names<br>
> + */<br>
> + std::vector<std::string> getSetNames( void ) const;<br>
> +<br>
> + /*!<br>
> + * This method returns all symbols for a given set.<br>
> + *<br>
> + * @param[in] symbolSetName specifies the symbol set of interest<br>
> + *<br>
> + * @return Returns all symbols for the given set<br>
> + */<br>
> + const std::vector<std::string>& getSymbolsForSet(<br>
> + const std::string& symbolSetName<br>
> + ) const;<br>
><br>
> /*!<br>
> * This method returns an indication of whether or not the specified<br>
> @@ -353,11 +394,6 @@ namespace Coverage {<br>
> */<br>
> void preprocess( void );<br>
><br>
> - /*!<br>
> - * This member contains the statistics kept on each symbol.<br>
> - */<br>
> - Statistics stats;<br>
> -<br>
> private:<br>
><br>
> /*!<br>
> @@ -369,6 +405,22 @@ namespace Coverage {<br>
> ExecutableInfo* const theExecutable<br>
> );<br>
><br>
> + /*!<br>
> + * This variable contains a map of symbol sets for each<br>
> + * symbol in the system keyed on the symbol name.<br>
> + */<br>
> + symbolSet_t set;<br>
> +<br>
> + /*!<br>
> + * This variable contains a map of symbol set names to symbol name lists.<br>
> + */<br>
> + std::map<std::string, std::vector<std::string>> setNamesToSymbols;<br>
> +<br>
> + /*!<br>
> + * This member contains a map of symbol set names to statistics.<br>
> + */<br>
> + std::map<std::string, Statistics> stats;<br>
> +<br>
> };<br>
> }<br>
><br>
> diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc<br>
> index 40ed209..fea776c 100644<br>
> --- a/tester/covoar/ReportsBase.cc<br>
> +++ b/tester/covoar/ReportsBase.cc<br>
> @@ -20,8 +20,9 @@<br>
><br>
> namespace Coverage {<br>
><br>
> -ReportsBase::ReportsBase( time_t timestamp ):<br>
> +ReportsBase::ReportsBase( time_t timestamp, std::string symbolSetName ):<br>
> reportExtension_m(""),<br>
> + symbolSetName_m(symbolSetName),<br>
> timestamp_m( timestamp )<br>
> {<br>
> }<br>
> @@ -31,27 +32,38 @@ ReportsBase::~ReportsBase()<br>
> }<br>
><br>
> FILE* ReportsBase::OpenFile(<br>
> - const char* const fileName<br>
> + const char* const fileName,<br>
> + const char* const symbolSetName<br>
> )<br>
> {<br>
> int sc;<br>
> FILE *aFile;<br>
> std::string file;<br>
><br>
> + std::string symbolSetOutputDirectory;<br>
> + rld::path::path_join(<br>
> + outputDirectory,<br>
> + symbolSetName,<br>
> + symbolSetOutputDirectory<br>
> + );<br>
> +<br>
> // Create the output directory if it does not already exist<br>
> #ifdef _WIN32<br>
> - sc = _mkdir( outputDirectory );<br>
> + sc = _mkdir( symbolSetOutputDirectory );<br>
> #else<br>
> - sc = mkdir( outputDirectory,0755 );<br>
> + sc = mkdir( symbolSetOutputDirectory.c_str(),0755 );<br>
> #endif<br>
> if ( (sc == -1) && (errno != EEXIST) ) {<br>
> - fprintf(stderr, "Unable to create output directory %s\n", outputDirectory);<br>
> + fprintf(<br>
> + stderr,<br>
> + "Unable to create output directory %s\n",<br>
> + symbolSetOutputDirectory.c_str()<br>
> + );<br>
> return NULL;<br>
> }<br>
><br>
> - file = outputDirectory;<br>
> - file += "/";<br>
> - file += fileName;<br>
> + file = symbolSetOutputDirectory;<br>
> + rld::path::path_join(file, fileName, file);<br>
><br>
> // Open the file.<br>
> aFile = fopen( file.c_str(), "w" );<br>
> @@ -71,7 +83,7 @@ FILE* ReportsBase::OpenAnnotatedFile(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
> FILE* ReportsBase::OpenBranchFile(<br>
> @@ -79,21 +91,21 @@ FILE* ReportsBase::OpenBranchFile(<br>
> bool hasBranches<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
> FILE* ReportsBase::OpenCoverageFile(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
> FILE* ReportsBase::OpenNoRangeFile(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
><br>
> @@ -101,14 +113,14 @@ FILE* ReportsBase::OpenSizeFile(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
> FILE* ReportsBase::OpenSymbolSummaryFile(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - return OpenFile(fileName);<br>
> + return OpenFile(fileName, symbolSetName_m.c_str());<br>
> }<br>
><br>
> void ReportsBase::CloseFile(<br>
> @@ -186,41 +198,42 @@ void ReportsBase::WriteAnnotatedReport(<br>
> const char* const fileName<br>
> ) {<br>
> FILE* aFile = NULL;<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr;<br>
> Coverage::CoverageRanges* theBranches;<br>
> Coverage::CoverageRanges* theRanges;<br>
> Coverage::CoverageMapBase* theCoverageMap = NULL;<br>
> uint32_t bAddress = 0;<br>
> AnnotatedLineState_t state;<br>
> - std::list<Coverage::ObjdumpProcessor::objdumpLine_t>* theInstructions;<br>
> - std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator itr;<br>
> + const std::list<Coverage::ObjdumpProcessor::objdumpLine_t>* theInstructions;<br>
> + std::list<<br>
> + Coverage::ObjdumpProcessor::objdumpLine_t>::const_iterator itr;<br>
><br>
> aFile = OpenAnnotatedFile(fileName);<br>
> if (!aFile)<br>
> return;<br>
><br>
> // Process uncovered branches for each symbol.<br>
> - for (ditr = SymbolsToAnalyze->set.begin();<br>
> - ditr != SymbolsToAnalyze->set.end();<br>
> - ditr++) {<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);<br>
> +<br>
> + for (const auto& symbol : symbols) {<br>
> + const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> // If uncoveredRanges and uncoveredBranches don't exist, then the<br>
> // symbol was never referenced by any executable. Just skip it.<br>
> - if ((ditr->second.uncoveredRanges == NULL) &&<br>
> - (ditr->second.uncoveredBranches == NULL))<br>
> + if ((info.uncoveredRanges == NULL) &&<br>
> + (info.uncoveredBranches == NULL))<br>
> continue;<br>
><br>
> // If uncoveredRanges and uncoveredBranches are empty, then everything<br>
> // must have been covered for this symbol. Just skip it.<br>
> - if ((ditr->second.uncoveredRanges->set.empty()) &&<br>
> - (ditr->second.uncoveredBranches->set.empty()))<br>
> + if ((info.uncoveredRanges->set.empty()) &&<br>
> + (info.uncoveredBranches->set.empty()))<br>
> continue;<br>
><br>
> - theCoverageMap = ditr->second.unifiedCoverageMap;<br>
> - bAddress = ditr->second.baseAddress;<br>
> - theInstructions = &(ditr->second.instructions);<br>
> - theRanges = ditr->second.uncoveredRanges;<br>
> - theBranches = ditr->second.uncoveredBranches;<br>
> + theCoverageMap = info.unifiedCoverageMap;<br>
> + bAddress = info.baseAddress;<br>
> + theInstructions = &(info.instructions);<br>
> + theRanges = info.uncoveredRanges;<br>
> + theBranches = info.uncoveredBranches;<br>
><br>
> // Add annotations to each line where necessary<br>
> AnnotatedStart( aFile );<br>
> @@ -274,14 +287,13 @@ void ReportsBase::WriteAnnotatedReport(<br>
> void ReportsBase::WriteBranchReport(<br>
> const char* const fileName<br>
> ) {<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr;<br>
> FILE* report = NULL;<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr;<br>
> Coverage::CoverageRanges* theBranches;<br>
> unsigned int count;<br>
> bool hasBranches = true;<br>
><br>
> - if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||<br>
> + if ((SymbolsToAnalyze->getNumberBranchesFound(symbolSetName_m) == 0) ||<br>
> (BranchInfoAvailable == false) )<br>
> hasBranches = false;<br>
><br>
> @@ -291,15 +303,16 @@ void ReportsBase::WriteBranchReport(<br>
> return;<br>
><br>
> // If no branches were found then branch coverage is not supported<br>
> - if ((SymbolsToAnalyze->getNumberBranchesFound() != 0) &&<br>
> + if ((SymbolsToAnalyze->getNumberBranchesFound(symbolSetName_m) != 0) &&<br>
> (BranchInfoAvailable == true) ) {<br>
> - // Process uncovered branches for each symbol.<br>
> + // Process uncovered branches for each symbol in the set.<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);<br>
> +<br>
> count = 0;<br>
> - for (ditr = SymbolsToAnalyze->set.begin();<br>
> - ditr != SymbolsToAnalyze->set.end();<br>
> - ditr++) {<br>
> + for (const auto& symbol : symbols) {<br>
> + const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> - theBranches = ditr->second.uncoveredBranches;<br>
> + theBranches = info.uncoveredBranches;<br>
><br>
> if (theBranches && !theBranches->set.empty()) {<br>
><br>
> @@ -307,7 +320,7 @@ void ReportsBase::WriteBranchReport(<br>
> ritr != theBranches->set.end() ;<br>
> ritr++ ) {<br>
> count++;<br>
> - PutBranchEntry( report, count, ditr, ritr );<br>
> + PutBranchEntry( report, count, symbol, info, ritr );<br>
> }<br>
> }<br>
> }<br>
> @@ -323,7 +336,6 @@ void ReportsBase::WriteCoverageReport(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr;<br>
> FILE* report;<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr;<br>
> Coverage::CoverageRanges* theRanges;<br>
> @@ -346,26 +358,27 @@ void ReportsBase::WriteCoverageReport(<br>
> }<br>
><br>
> // Process uncovered ranges for each symbol.<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);<br>
> +<br>
> count = 0;<br>
> - for (ditr = SymbolsToAnalyze->set.begin();<br>
> - ditr != SymbolsToAnalyze->set.end();<br>
> - ditr++) {<br>
> + for (const auto& symbol : symbols) {<br>
> + const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> - theRanges = ditr->second.uncoveredRanges;<br>
> + theRanges = info.uncoveredRanges;<br>
><br>
> // If uncoveredRanges doesn't exist, then the symbol was never<br>
> // referenced by any executable. There may be a problem with the<br>
> // desired symbols list or with the executables so put something<br>
> // in the report.<br>
> if (theRanges == NULL) {<br>
> - putCoverageNoRange( report, NoRangeFile, count, ditr->first );<br>
> + putCoverageNoRange( report, NoRangeFile, count, symbol );<br>
> count++;<br>
> } else if (!theRanges->set.empty()) {<br>
><br>
> for (ritr = theRanges->set.begin() ;<br>
> ritr != theRanges->set.end() ;<br>
> ritr++ ) {<br>
> - PutCoverageLine( report, count, ditr, ritr );<br>
> + PutCoverageLine( report, count, symbol, info, ritr );<br>
> count++;<br>
> }<br>
> }<br>
> @@ -383,7 +396,6 @@ void ReportsBase::WriteSizeReport(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr;<br>
> FILE* report;<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr;<br>
> Coverage::CoverageRanges* theRanges;<br>
> @@ -396,19 +408,20 @@ void ReportsBase::WriteSizeReport(<br>
> }<br>
><br>
> // Process uncovered ranges for each symbol.<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);<br>
> +<br>
> count = 0;<br>
> - for (ditr = SymbolsToAnalyze->set.begin();<br>
> - ditr != SymbolsToAnalyze->set.end();<br>
> - ditr++) {<br>
> + for (const auto& symbol : symbols) {<br>
> + const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> - theRanges = ditr->second.uncoveredRanges;<br>
> + theRanges = info.uncoveredRanges;<br>
><br>
> if (theRanges && !theRanges->set.empty()) {<br>
><br>
> for (ritr = theRanges->set.begin() ;<br>
> ritr != theRanges->set.end() ;<br>
> ritr++ ) {<br>
> - PutSizeLine( report, count, ditr, ritr );<br>
> + PutSizeLine( report, count, symbol, ritr );<br>
> count++;<br>
> }<br>
> }<br>
> @@ -421,7 +434,6 @@ void ReportsBase::WriteSymbolSummaryReport(<br>
> const char* const fileName<br>
> )<br>
> {<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr;<br>
> FILE* report;<br>
> unsigned int count;<br>
><br>
> @@ -432,12 +444,13 @@ void ReportsBase::WriteSymbolSummaryReport(<br>
> }<br>
><br>
> // Process each symbol.<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);<br>
> +<br>
> count = 0;<br>
> - for (ditr = SymbolsToAnalyze->set.begin();<br>
> - ditr != SymbolsToAnalyze->set.end();<br>
> - ditr++) {<br>
> + for (const auto& symbol : symbols) {<br>
> + const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> - PutSymbolSummaryLine( report, count, ditr );<br>
> + PutSymbolSummaryLine( report, count, symbol, info );<br>
> count++;<br>
> }<br>
><br>
> @@ -445,13 +458,13 @@ void ReportsBase::WriteSymbolSummaryReport(<br>
> }<br>
><br>
> void ReportsBase::WriteSummaryReport(<br>
> - const char* const fileName<br>
> + const char* const fileName,<br>
> + const char* const symbolSetName<br>
> )<br>
> {<br>
> // Calculate coverage statistics and output results.<br>
> uint32_t a;<br>
> uint32_t endAddress;<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator itr;<br>
> uint32_t notExecuted = 0;<br>
> double percentage;<br>
> double percentageBranches;<br>
> @@ -460,22 +473,23 @@ void ReportsBase::WriteSummaryReport(<br>
> FILE* report;<br>
><br>
> // Open the report file.<br>
> - report = OpenFile( fileName );<br>
> + report = OpenFile( fileName, symbolSetName );<br>
> if ( !report ) {<br>
> return;<br>
> }<br>
><br>
> // Look at each symbol.<br>
> - for (itr = SymbolsToAnalyze->set.begin();<br>
> - itr != SymbolsToAnalyze->set.end();<br>
> - itr++) {<br>
> + const std::vector<std::string>& symbols = SymbolsToAnalyze->getSymbolsForSet(symbolSetName);<br>
> +<br>
> + for (const auto& symbol : symbols) {<br>
> + SymbolInformation info = SymbolsToAnalyze->allSymbols().at(symbol);<br>
><br>
> // If the symbol's unified coverage map exists, scan through it<br>
> // and count bytes.<br>
> - theCoverageMap = itr->second.unifiedCoverageMap;<br>
> + theCoverageMap = info.unifiedCoverageMap;<br>
> if (theCoverageMap) {<br>
><br>
> - endAddress = itr->second.stats.sizeInBytes - 1;<br>
> + endAddress = info.stats.sizeInBytes - 1;<br>
><br>
> for (a = 0; a <= endAddress; a++) {<br>
> totalBytes++;<br>
> @@ -490,11 +504,12 @@ void ReportsBase::WriteSummaryReport(<br>
> percentage *= 100.0;<br>
><br>
> percentageBranches = (double) (<br>
> - SymbolsToAnalyze->getNumberBranchesAlwaysTaken() +<br>
> - SymbolsToAnalyze->getNumberBranchesNeverTaken() +<br>
> - (SymbolsToAnalyze->getNumberBranchesNotExecuted() * 2)<br>
> + SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName) +<br>
> + SymbolsToAnalyze->getNumberBranchesNeverTaken(symbolSetName) +<br>
> + (SymbolsToAnalyze->getNumberBranchesNotExecuted(symbolSetName) * 2)<br>
> );<br>
> - percentageBranches /= (double) SymbolsToAnalyze->getNumberBranchesFound() * 2;<br>
> + percentageBranches /=<br>
> + (double) SymbolsToAnalyze->getNumberBranchesFound(symbolSetName) * 2;<br>
> percentageBranches *= 100.0;<br>
><br>
> fprintf( report, "Bytes Analyzed : %d\n", totalBytes );<br>
> @@ -504,48 +519,48 @@ void ReportsBase::WriteSummaryReport(<br>
> fprintf(<br>
> report,<br>
> "Unreferenced Symbols : %d\n",<br>
> - SymbolsToAnalyze->getNumberUnreferencedSymbols()<br>
> + SymbolsToAnalyze->getNumberUnreferencedSymbols(symbolSetName)<br>
> );<br>
> fprintf(<br>
> report,<br>
> "Uncovered ranges found : %d\n\n",<br>
> - SymbolsToAnalyze->getNumberUncoveredRanges()<br>
> + SymbolsToAnalyze->getNumberUncoveredRanges(symbolSetName)<br>
> );<br>
> - if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||<br>
> + if ((SymbolsToAnalyze->getNumberBranchesFound(symbolSetName) == 0) ||<br>
> (BranchInfoAvailable == false) ) {<br>
> fprintf( report, "No branch information available\n" );<br>
> } else {<br>
> fprintf(<br>
> report,<br>
> "Total conditional branches found : %d\n",<br>
> - SymbolsToAnalyze->getNumberBranchesFound()<br>
> + SymbolsToAnalyze->getNumberBranchesFound(symbolSetName)<br>
> );<br>
> fprintf(<br>
> report,<br>
> "Total branch paths found : %d\n",<br>
> - SymbolsToAnalyze->getNumberBranchesFound() * 2<br>
> + SymbolsToAnalyze->getNumberBranchesFound(symbolSetName) * 2<br>
> );<br>
> fprintf(<br>
> report,<br>
> "Uncovered branch paths found : %d\n",<br>
> - SymbolsToAnalyze->getNumberBranchesAlwaysTaken() +<br>
> - SymbolsToAnalyze->getNumberBranchesNeverTaken() +<br>
> - (SymbolsToAnalyze->getNumberBranchesNotExecuted() * 2)<br>
> + SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName) +<br>
> + SymbolsToAnalyze->getNumberBranchesNeverTaken(symbolSetName) +<br>
> + (SymbolsToAnalyze->getNumberBranchesNotExecuted(symbolSetName) * 2)<br>
> );<br>
> fprintf(<br>
> report,<br>
> " %d branches always taken\n",<br>
> - SymbolsToAnalyze->getNumberBranchesAlwaysTaken()<br>
> + SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName)<br>
> );<br>
> fprintf(<br>
> report,<br>
> " %d branches never taken\n",<br>
> - SymbolsToAnalyze->getNumberBranchesNeverTaken()<br>
> + SymbolsToAnalyze->getNumberBranchesNeverTaken(symbolSetName)<br>
> );<br>
> fprintf(<br>
> report,<br>
> " %d branch paths not executed\n",<br>
> - SymbolsToAnalyze->getNumberBranchesNotExecuted() * 2<br>
> + SymbolsToAnalyze->getNumberBranchesNotExecuted(symbolSetName) * 2<br>
> );<br>
> fprintf(<br>
> report,<br>
> @@ -555,7 +570,7 @@ void ReportsBase::WriteSummaryReport(<br>
> }<br>
> }<br>
><br>
> -void GenerateReports()<br>
> +void GenerateReports(const std::string& symbolSetName)<br>
> {<br>
> typedef std::list<ReportsBase *> reportList_t;<br>
><br>
> @@ -568,9 +583,9 @@ void GenerateReports()<br>
><br>
><br>
> timestamp = time(NULL); /* get current cal time */<br>
> - reports = new ReportsText(timestamp);<br>
> + reports = new ReportsText(timestamp, symbolSetName);<br>
> reportList.push_back(reports);<br>
> - reports = new ReportsHtml(timestamp);<br>
> + reports = new ReportsHtml(timestamp, symbolSetName);<br>
> reportList.push_back(reports);<br>
><br>
> for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {<br>
> @@ -624,7 +639,7 @@ void GenerateReports()<br>
> delete reports;<br>
> }<br>
><br>
> - ReportsBase::WriteSummaryReport( "summary.txt" );<br>
> + ReportsBase::WriteSummaryReport( "summary.txt", symbolSetName.c_str() );<br>
> }<br>
><br>
> }<br>
> diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h<br>
> index 7e28fd8..e7b1fb3 100644<br>
> --- a/tester/covoar/ReportsBase.h<br>
> +++ b/tester/covoar/ReportsBase.h<br>
> @@ -24,7 +24,7 @@ namespace Coverage {<br>
> class ReportsBase {<br>
><br>
> public:<br>
> - ReportsBase( time_t timestamp );<br>
> + ReportsBase( time_t timestamp, std::string symbolSetName );<br>
> virtual ~ReportsBase();<br>
><br>
> /*!<br>
> @@ -90,7 +90,8 @@ class ReportsBase {<br>
> * This method produces a sumary report for the overall test run.<br>
> */<br>
> static void WriteSummaryReport(<br>
> - const char* const fileName<br>
> + const char* const fileName,<br>
> + const char* const symbolSetName<br>
> );<br>
><br>
> /*!<br>
> @@ -118,6 +119,11 @@ class ReportsBase {<br>
> */<br>
> std::string reportExtension_m;<br>
><br>
> + /*!<br>
> + * This member variable contains the name of the symbol set for the report.<br>
> + */<br>
> + std::string symbolSetName_m;<br>
> +<br>
> /*!<br>
> * This member variable contains the timestamp for the report.<br>
> */<br>
> @@ -128,9 +134,11 @@ class ReportsBase {<br>
> * correctly. Upon failure NULL is returned.<br>
> *<br>
> * @param[in] fileName identifies the report file name<br>
> + * @param[in] symbolSetName identifies the name of the report's symbol set<br>
> */<br>
> static FILE* OpenFile(<br>
> - const char* const fileName<br>
> + const char* const fileName,<br>
> + const char* const symbolSetName<br>
> );<br>
><br>
> /*!<br>
> @@ -318,13 +326,15 @@ class ReportsBase {<br>
> *<br>
> * @param[in] report identifies the report file name<br>
> * @param[in] number identifies the line number.<br>
> - * @param[in] symbolPtr is a pointer to the symbol information<br>
> + * @param[in] symbolName is the symbol's name.<br>
> + * @param[in] symbolInfo is the symbol's information.<br>
> * @param[in] rangePtr is a pointer to the range information.<br>
> */<br>
> virtual bool PutBranchEntry(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> )=0;<br>
><br>
> @@ -348,13 +358,15 @@ class ReportsBase {<br>
> *<br>
> * @param[in] report identifies the report file name<br>
> * @param[in] number identifies the line number.<br>
> - * @param[in] ditr is a iterator to the symbol information<br>
> + * @param[in] symbolName is the symbol's name.<br>
> + * @param[in] symbolInfo is the symbol's information.<br>
> * @param[in] ritr is a iterator to the range information.<br>
> */<br>
> virtual bool PutCoverageLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr<br>
> )=0;<br>
><br>
> @@ -363,13 +375,13 @@ class ReportsBase {<br>
> *<br>
> * @param[in] report identifies the size report file name<br>
> * @param[in] number identifies the line number.<br>
> - * @param[in] symbol is a pointer to the symbol information<br>
> + * @param[in] symbolName is the symbol's name.<br>
> * @param[in] range is a iterator to the range information.<br>
> */<br>
> virtual bool PutSizeLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol,<br>
> + const std::string& symbolName,<br>
> Coverage::CoverageRanges::ranges_t::iterator range<br>
> )=0;<br>
><br>
> @@ -378,20 +390,24 @@ class ReportsBase {<br>
> *<br>
> * @param[in] report identifies the report file name<br>
> * @param[in] number identifies the line number.<br>
> - * @param[in] symbol is a pointer to the symbol information<br>
> + * @param[in] symbolName is the symbol's name.<br>
> + * @param[in] symbolInfo is the symbol's information.<br>
> */<br>
> virtual bool PutSymbolSummaryLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo<br>
> )=0;<br>
> };<br>
><br>
> /*!<br>
> * This method iterates over all report set types and generates<br>
> * all reports.<br>
> + *<br>
> + * @param[in] symbolSetName is the name of the symbol set to report on.<br>
> */<br>
> -void GenerateReports();<br>
> +void GenerateReports(const std::string& symbolSetName);<br>
><br>
> }<br>
><br>
> diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc<br>
> index 6406a48..7137016 100644<br>
> --- a/tester/covoar/ReportsHtml.cc<br>
> +++ b/tester/covoar/ReportsHtml.cc<br>
> @@ -31,8 +31,8 @@<br>
><br>
> namespace Coverage {<br>
><br>
> - ReportsHtml::ReportsHtml( time_t timestamp ):<br>
> - ReportsBase( timestamp )<br>
> + ReportsHtml::ReportsHtml( time_t timestamp, std::string symbolSetName ):<br>
> + ReportsBase( timestamp, symbolSetName )<br>
> {<br>
> reportExtension_m = ".html";<br>
> }<br>
> @@ -113,7 +113,7 @@ namespace Coverage {<br>
> FILE* aFile;<br>
><br>
> // Open the file<br>
> - aFile = ReportsBase::OpenFile( fileName );<br>
> + aFile = ReportsBase::OpenFile( fileName, symbolSetName_m.c_str() );<br>
><br>
> // Put Header information on the file<br>
> fprintf(<br>
> @@ -488,7 +488,8 @@ namespace Coverage {<br>
> FILE* report<br>
> )<br>
> {<br>
> - if (BranchInfoAvailable && SymbolsToAnalyze->getNumberBranchesFound() != 0)<br>
> + if (BranchInfoAvailable &&<br>
> + SymbolsToAnalyze->getNumberBranchesFound(symbolSetName_m) != 0)<br>
> fprintf( report, "All branch paths taken.\n" );<br>
> else<br>
> fprintf( report, "No branch information found.\n" );<br>
> @@ -498,7 +499,8 @@ namespace Coverage {<br>
> bool ReportsHtml::PutBranchEntry(<br>
> FILE* report,<br>
> unsigned int count,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> )<br>
> {<br>
> @@ -519,7 +521,7 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%s</td>\n",<br>
> - symbolPtr->first.c_str()<br>
> + symbolName.c_str()<br>
> );<br>
><br>
> // line<br>
> @@ -562,8 +564,8 @@ namespace Coverage {<br>
><br>
> // Taken / Not taken counts<br>
> lowAddress = rangePtr->lowAddress;<br>
> - bAddress = symbolPtr->second.baseAddress;<br>
> - theCoverageMap = symbolPtr->second.unifiedCoverageMap;<br>
> + bAddress = symbolInfo.baseAddress;<br>
> + theCoverageMap = symbolInfo.unifiedCoverageMap;<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> @@ -703,7 +705,8 @@ namespace Coverage {<br>
> bool ReportsHtml::PutCoverageLine(<br>
> FILE* report,<br>
> unsigned int count,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> )<br>
> {<br>
> @@ -721,7 +724,7 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%s</td>\n",<br>
> - symbolPtr->first.c_str()<br>
> + symbolName.c_str()<br>
> );<br>
><br>
> // Range<br>
> @@ -790,7 +793,7 @@ namespace Coverage {<br>
> bool ReportsHtml::PutSizeLine(<br>
> FILE* report,<br>
> unsigned int count,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol,<br>
> + const std::string& symbolName,<br>
> Coverage::CoverageRanges::ranges_t::iterator range<br>
> )<br>
> {<br>
> @@ -814,7 +817,7 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%s</td>\n",<br>
> - symbol->first.c_str()<br>
> + symbolName.c_str()<br>
> );<br>
><br>
> // line<br>
> @@ -842,7 +845,8 @@ namespace Coverage {<br>
> bool ReportsHtml::PutSymbolSummaryLine(<br>
> FILE* report,<br>
> unsigned int count,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo<br>
> )<br>
> {<br>
><br>
> @@ -856,10 +860,10 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%s</td>\n",<br>
> - symbol->first.c_str()<br>
> + symbolName.c_str()<br>
> );<br>
><br>
> - if (symbol->second.stats.sizeInBytes == 0) {<br>
> + if (symbolInfo.stats.sizeInBytes == 0) {<br>
> // The symbol has never been seen. Write "unknown" for all columns.<br>
> fprintf(<br>
> report,<br>
> @@ -879,60 +883,60 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.sizeInBytes<br>
> + symbolInfo.stats.sizeInBytes<br>
> );<br>
><br>
> // Total Size in Instructions<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.sizeInInstructions<br>
> + symbolInfo.stats.sizeInInstructions<br>
> );<br>
><br>
> // Total Uncovered Ranges<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.uncoveredRanges<br>
> + symbolInfo.stats.uncoveredRanges<br>
> );<br>
><br>
> // Uncovered Size in Bytes<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.uncoveredBytes<br>
> + symbolInfo.stats.uncoveredBytes<br>
> );<br>
><br>
> // Uncovered Size in Instructions<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.uncoveredInstructions<br>
> + symbolInfo.stats.uncoveredInstructions<br>
> );<br>
><br>
> // Total number of branches<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted<br>
> + symbolInfo.stats.branchesNotExecuted + symbolInfo.stats.branchesExecuted<br>
> );<br>
><br>
> // Total Always Taken<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.branchesAlwaysTaken<br>
> + symbolInfo.stats.branchesAlwaysTaken<br>
> );<br>
><br>
> // Total Never Taken<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%d</td>\n",<br>
> - symbol->second.stats.branchesNeverTaken<br>
> + symbolInfo.stats.branchesNeverTaken<br>
> );<br>
><br>
> // % Uncovered Instructions<br>
> - if ( symbol->second.stats.sizeInInstructions == 0 )<br>
> + if ( symbolInfo.stats.sizeInInstructions == 0 )<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">100.00</td>\n"<br>
> @@ -941,12 +945,12 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n",<br>
> - (symbol->second.stats.uncoveredInstructions*100.0)/<br>
> - symbol->second.stats.sizeInInstructions<br>
> + (symbolInfo.stats.uncoveredInstructions*100.0)/<br>
> + symbolInfo.stats.sizeInInstructions<br>
> );<br>
><br>
> // % Uncovered Bytes<br>
> - if ( symbol->second.stats.sizeInBytes == 0 )<br>
> + if ( symbolInfo.stats.sizeInBytes == 0 )<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">100.00</td>\n"<br>
> @@ -955,8 +959,8 @@ namespace Coverage {<br>
> fprintf(<br>
> report,<br>
> "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n",<br>
> - (symbol->second.stats.uncoveredBytes*100.0)/<br>
> - symbol->second.stats.sizeInBytes<br>
> + (symbolInfo.stats.uncoveredBytes*100.0)/<br>
> + symbolInfo.stats.sizeInBytes<br>
> );<br>
> }<br>
><br>
> diff --git a/tester/covoar/ReportsHtml.h b/tester/covoar/ReportsHtml.h<br>
> index 34193da..7972ce1 100644<br>
> --- a/tester/covoar/ReportsHtml.h<br>
> +++ b/tester/covoar/ReportsHtml.h<br>
> @@ -22,7 +22,7 @@ namespace Coverage {<br>
> class ReportsHtml: public ReportsBase {<br>
><br>
> public:<br>
> - ReportsHtml( time_t timestamp );<br>
> + ReportsHtml( time_t timestamp, std::string symbolSetName );<br>
> ~ReportsHtml();<br>
><br>
> /*!<br>
> @@ -163,7 +163,8 @@ class ReportsHtml: public ReportsBase {<br>
> virtual bool PutBranchEntry(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> );<br>
><br>
> @@ -179,7 +180,8 @@ class ReportsHtml: public ReportsBase {<br>
> virtual bool PutCoverageLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr<br>
> );<br>
><br>
> @@ -187,7 +189,7 @@ class ReportsHtml: public ReportsBase {<br>
> virtual bool PutSizeLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol,<br>
> + const std::string& symbolName,<br>
> Coverage::CoverageRanges::ranges_t::iterator range<br>
> );<br>
><br>
> @@ -195,7 +197,8 @@ class ReportsHtml: public ReportsBase {<br>
> virtual bool PutSymbolSummaryLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo<br>
> );<br>
><br>
> /* Inherit documentation from base class. */<br>
> diff --git a/tester/covoar/ReportsText.cc b/tester/covoar/ReportsText.cc<br>
> index a3923e6..f552cdd 100644<br>
> --- a/tester/covoar/ReportsText.cc<br>
> +++ b/tester/covoar/ReportsText.cc<br>
> @@ -11,8 +11,8 @@<br>
><br>
> namespace Coverage {<br>
><br>
> -ReportsText::ReportsText( time_t timestamp ):<br>
> - ReportsBase( timestamp )<br>
> +ReportsText::ReportsText( time_t timestamp, std::string symbolSetName ):<br>
> + ReportsBase( timestamp, symbolSetName )<br>
> {<br>
> reportExtension_m = ".txt";<br>
> }<br>
> @@ -52,7 +52,8 @@ bool ReportsText::PutNoBranchInfo(<br>
> FILE* report<br>
> )<br>
> {<br>
> - if ( BranchInfoAvailable && SymbolsToAnalyze->getNumberBranchesFound() != 0 )<br>
> + if ( BranchInfoAvailable &&<br>
> + SymbolsToAnalyze->getNumberBranchesFound(symbolSetName_m) != 0 )<br>
> fprintf( report, "All branch paths taken.\n" );<br>
> else<br>
> fprintf( report, "No branch information found.\n" );<br>
> @@ -61,9 +62,10 @@ bool ReportsText::PutNoBranchInfo(<br>
><br>
><br>
> bool ReportsText::PutBranchEntry(<br>
> - FILE* report,<br>
> + FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> )<br>
> {<br>
> @@ -76,8 +78,8 @@ bool ReportsText::PutBranchEntry(<br>
> "Symbol : %s (0x%x)\n"<br>
> "Line : %s (0x%x)\n"<br>
> "Size in Bytes : %d\n",<br>
> - symbolPtr->first.c_str(),<br>
> - symbolPtr->second.baseAddress,<br>
> + symbolName.c_str(),<br>
> + symbolInfo.baseAddress,<br>
> rangePtr->lowSourceLine.c_str(),<br>
> rangePtr->lowAddress,<br>
> rangePtr->highAddress - rangePtr->lowAddress + 1<br>
> @@ -153,9 +155,10 @@ void ReportsText::putCoverageNoRange(<br>
> }<br>
><br>
> bool ReportsText::PutCoverageLine(<br>
> - FILE* report,<br>
> - unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr,<br>
> + FILE* report,<br>
> + unsigned int number,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr<br>
> )<br>
> {<br>
> @@ -171,8 +174,8 @@ bool ReportsText::PutCoverageLine(<br>
> "Size in Bytes : %d\n"<br>
> "Size in Instructions : %d\n\n",<br>
> ritr->id,<br>
> - ditr->first.c_str(),<br>
> - ditr->second.baseAddress,<br>
> + symbolName.c_str(),<br>
> + symbolInfo.baseAddress,<br>
> ritr->lowSourceLine.c_str(),<br>
> ritr->lowAddress,<br>
> ritr->highSourceLine.c_str(),<br>
> @@ -210,9 +213,9 @@ bool ReportsText::PutCoverageLine(<br>
> }<br>
><br>
> bool ReportsText::PutSizeLine(<br>
> - FILE* report,<br>
> - unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol,<br>
> + FILE* report,<br>
> + unsigned int number,<br>
> + const std::string& symbolName,<br>
> Coverage::CoverageRanges::ranges_t::iterator range<br>
> )<br>
> {<br>
> @@ -220,7 +223,7 @@ bool ReportsText::PutSizeLine(<br>
> report,<br>
> "%d\t%s\t%s\n",<br>
> range->highAddress - range->lowAddress + 1,<br>
> - symbol->first.c_str(),<br>
> + symbolName.c_str(),<br>
> range->lowSourceLine.c_str()<br>
> );<br>
> return true;<br>
> @@ -229,13 +232,14 @@ bool ReportsText::PutSizeLine(<br>
> bool ReportsText::PutSymbolSummaryLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo<br>
> )<br>
> {<br>
> float uncoveredBytes;<br>
> float uncoveredInstructions;<br>
><br>
> - if (symbol->second.stats.sizeInBytes == 0) {<br>
> + if (symbolInfo.stats.sizeInBytes == 0) {<br>
> fprintf(<br>
> report,<br>
> "============================================\n"<br>
> @@ -245,20 +249,20 @@ bool ReportsText::PutSymbolSummaryLine(<br>
> "Therefore there is no size or disassembly for this symbol.\n"<br>
> "This could be due to symbol misspelling or lack of a test for\n"<br>
> "this symbol.\n",<br>
> - symbol->first.c_str()<br>
> + symbolName.c_str()<br>
> );<br>
> } else {<br>
> - if ( symbol->second.stats.sizeInInstructions == 0 )<br>
> + if ( symbolInfo.stats.sizeInInstructions == 0 )<br>
> uncoveredInstructions = 0;<br>
> else<br>
> - uncoveredInstructions = (symbol->second.stats.uncoveredInstructions*100.0)/<br>
> - symbol->second.stats.sizeInInstructions;<br>
> + uncoveredInstructions = (symbolInfo.stats.uncoveredInstructions*100.0)/<br>
> + symbolInfo.stats.sizeInInstructions;<br>
><br>
> - if ( symbol->second.stats.sizeInBytes == 0 )<br>
> + if ( symbolInfo.stats.sizeInBytes == 0 )<br>
> uncoveredBytes = 0;<br>
> else<br>
> - uncoveredBytes = (symbol->second.stats.uncoveredBytes*100.0)/<br>
> - symbol->second.stats.sizeInBytes;<br>
> + uncoveredBytes = (symbolInfo.stats.uncoveredBytes*100.0)/<br>
> + symbolInfo.stats.sizeInBytes;<br>
><br>
> fprintf(<br>
> report,<br>
> @@ -271,12 +275,12 @@ bool ReportsText::PutSymbolSummaryLine(<br>
> "Total Never Taken : %d\n"<br>
> "Percentage Uncovered Instructions : %.2f\n"<br>
> "Percentage Uncovered Bytes : %.2f\n",<br>
> - symbol->first.c_str(),<br>
> - symbol->second.stats.sizeInBytes,<br>
> - symbol->second.stats.sizeInInstructions,<br>
> - symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted,<br>
> - symbol->second.stats.branchesAlwaysTaken,<br>
> - symbol->second.stats.branchesNeverTaken,<br>
> + symbolName.c_str(),<br>
> + symbolInfo.stats.sizeInBytes,<br>
> + symbolInfo.stats.sizeInInstructions,<br>
> + symbolInfo.stats.branchesNotExecuted + symbolInfo.stats.branchesExecuted,<br>
> + symbolInfo.stats.branchesAlwaysTaken,<br>
> + symbolInfo.stats.branchesNeverTaken,<br>
> uncoveredInstructions,<br>
> uncoveredBytes<br>
> );<br>
> diff --git a/tester/covoar/ReportsText.h b/tester/covoar/ReportsText.h<br>
> index 9ae87d4..cf8a813 100644<br>
> --- a/tester/covoar/ReportsText.h<br>
> +++ b/tester/covoar/ReportsText.h<br>
> @@ -21,7 +21,7 @@ namespace Coverage {<br>
> class ReportsText: public ReportsBase {<br>
><br>
> public:<br>
> - ReportsText( time_t timestamp );<br>
> + ReportsText( time_t timestamp, std::string symbolSetName );<br>
> virtual ~ReportsText();<br>
><br>
> /*!<br>
> @@ -83,7 +83,8 @@ class ReportsText: public ReportsBase {<br>
> virtual bool PutBranchEntry(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator rangePtr<br>
> );<br>
><br>
> @@ -99,7 +100,8 @@ class ReportsText: public ReportsBase {<br>
> virtual bool PutCoverageLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator ditr,<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo,<br>
> Coverage::CoverageRanges::ranges_t::iterator ritr<br>
> );<br>
><br>
> @@ -107,7 +109,7 @@ class ReportsText: public ReportsBase {<br>
> virtual bool PutSizeLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol,<br>
> + const std::string& symbolName,<br>
> Coverage::CoverageRanges::ranges_t::iterator range<br>
> );<br>
><br>
> @@ -115,7 +117,8 @@ class ReportsText: public ReportsBase {<br>
> virtual bool PutSymbolSummaryLine(<br>
> FILE* report,<br>
> unsigned int number,<br>
> - Coverage::DesiredSymbols::symbolSet_t::iterator symbol<br>
> + const std::string& symbolName,<br>
> + const SymbolInformation& symbolInfo<br>
> );<br>
> };<br>
><br>
> diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc<br>
> index 84d883a..8d63132 100644<br>
> --- a/tester/covoar/covoar.cc<br>
> +++ b/tester/covoar/covoar.cc<br>
> @@ -350,7 +350,7 @@ int covoar(<br>
> throw rld::error( "executables and coverage name size mismatch", "covoar" );<br>
><br>
> if ( Verbose )<br>
> - std::cerr << "Analyzing " << SymbolsToAnalyze->set.size()<br>
> + std::cerr << "Analyzing " << SymbolsToAnalyze->allSymbols().size()<br>
> << " symbols" << std::endl;<br>
><br>
> // Create explanations.<br>
> @@ -473,7 +473,9 @@ int covoar(<br>
> if (Verbose)<br>
> std::cerr << "Generate Reports" << std::endl;<br>
><br>
> - Coverage::GenerateReports();<br>
> + for (const auto& setName : SymbolsToAnalyze->getSetNames()) {<br>
> + Coverage::GenerateReports(setName);<br>
> + }<br>
><br>
> // Write explanations that were not found.<br>
> if ( explanations ) {<br>
> --<br>
> 2.27.0<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>