Changeset ac56fce in rtems-tools
- Timestamp:
- 04/30/21 19:34:18 (3 years ago)
- Branches:
- master
- Children:
- 2650d70
- Parents:
- a88be93
- git-author:
- Alex White <alex.white@…> (04/30/21 19:34:18)
- git-committer:
- Joel Sherrill <joel@…> (06/17/21 21:00:08)
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemstoolkit/rld-dwarf.cpp
ra88be93 rac56fce 1894 1894 } 1895 1895 1896 const addresses& compilation_unit::get_addresses () const 1897 { 1898 return addr_lines_; 1899 } 1900 1896 1901 functions& 1897 1902 compilation_unit::get_functions () -
rtemstoolkit/rld-dwarf.h
ra88be93 rac56fce 709 709 710 710 /** 711 * The addresses associated with this compilation unit. 712 */ 713 const addresses& get_addresses () const; 714 715 /** 711 716 * Get the source and line for an address. If the address does not match 712 717 * false is returned the file is set to 'unknown' and the line is set to -
tester/covoar/ExecutableInfo.cc
ra88be93 rac56fce 41 41 executable.load_symbols(symbols); 42 42 43 rld::dwarf::file debug; 44 43 45 debug.begin(executable.elf()); 44 46 debug.load_debug(); 45 47 debug.load_functions(); 46 48 47 try { 48 for (auto& cu : debug.get_cus()) { 49 for (auto& func : cu.get_functions()) { 50 if (!func.has_machine_code()) { 49 for (auto& cu : debug.get_cus()) { 50 AddressLineRange& range = mapper.makeRange(cu.pc_low(), cu.pc_high()); 51 // Does not filter on desired symbols under the assumption that the test 52 // code and any support code is small relative to what is being tested. 53 for (const auto &address : cu.get_addresses()) { 54 range.addSourceLine(address); 55 } 56 57 for (auto& func : cu.get_functions()) { 58 if (!func.has_machine_code()) { 59 continue; 60 } 61 62 if (!SymbolsToAnalyze->isDesired(func.name())) { 63 continue; 64 } 65 66 if (func.is_inlined()) { 67 if (func.is_external()) { 68 // Flag it 69 std::cerr << "Function is both external and inlined: " 70 << func.name() << std::endl; 71 } 72 73 if (func.has_entry_pc()) { 51 74 continue; 52 75 } 53 76 54 if (!SymbolsToAnalyze->isDesired(func.name())) { 77 // If the low PC address is zero, the symbol does not appear in 78 // this executable. 79 if (func.pc_low() == 0) { 55 80 continue; 56 81 } 57 58 if (func.is_inlined()) { 59 if (func.is_external()) { 60 // Flag it 61 std::cerr << "Function is both external and inlined: " 62 << func.name() << std::endl; 63 } 64 65 if (func.has_entry_pc()) { 66 continue; 67 } 68 69 // If the low PC address is zero, the symbol does not appear in 70 // this executable. 71 if (func.pc_low() == 0) { 72 continue; 73 } 74 } 75 76 // We can't process a zero size function. 77 if (func.pc_high() == 0) { 78 continue; 79 } 80 81 createCoverageMap (cu.name(), func.name(), 82 func.pc_low(), func.pc_high() - 1); 83 } 82 } 83 84 // We can't process a zero size function. 85 if (func.pc_high() == 0) { 86 continue; 87 } 88 89 createCoverageMap (cu.name(), func.name(), 90 func.pc_low(), func.pc_high() - 1); 84 91 } 85 } catch (...) { 86 debug.end(); 87 throw; 88 } 89 90 // Can't cleanup handles until the destructor because the information is 91 // referenced elsewhere. NOTE: This could cause problems from too many open 92 // file descriptors. 92 } 93 93 } 94 94 95 95 ExecutableInfo::~ExecutableInfo() 96 96 { 97 debug.end();98 97 } 99 98 … … 198 197 std::string file; 199 198 int lno; 200 debug.get_source (address, file, lno);199 mapper.getSource (address, file, lno); 201 200 std::ostringstream ss; 202 201 ss << file << ':' << lno; -
tester/covoar/ExecutableInfo.h
ra88be93 rac56fce 16 16 #include <rld-symbols.h> 17 17 18 #include "AddressToLineMapper.h" 18 19 #include "CoverageMapBase.h" 19 20 #include "SymbolTable.h" … … 159 160 160 161 /*! 161 * The DWARF data to the ELF executable.162 */163 rld::dwarf::file debug;164 165 /*!166 162 * The executable's file name. 167 163 */ … … 172 168 */ 173 169 rld::symbols::table symbols; 170 171 /*! 172 * The address-to-line mapper for this executable. 173 */ 174 AddressToLineMapper mapper; 174 175 175 176 /*! -
tester/covoar/wscript
ra88be93 rac56fce 84 84 bld.stlib(target = 'ccovoar', 85 85 source = ['app_common.cc', 86 'AddressToLineMapper.cc', 86 87 'CoverageFactory.cc', 87 88 'CoverageMap.cc',
Note: See TracChangeset
for help on using the changeset viewer.