summaryrefslogtreecommitdiffstats
path: root/tester/covoar/covoar.cc
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-03-03 09:37:47 -0600
committerJoel Sherrill <joel@rtems.org>2021-03-30 13:15:58 -0500
commita7802e376adb7f99772a8c9b92fbd1c6c3f93a9b (patch)
treedeae9168232841912c357fdb99423d6dbf3d22b4 /tester/covoar/covoar.cc
parentcovoar/TargetBase: Fix QEMU branch info (diff)
downloadrtems-tools-a7802e376adb7f99772a8c9b92fbd1c6c3f93a9b.tar.bz2
covoar: Fix DWARF reading
There were a couple of issues with the way the DWARF info was being read. The first issue was that it inefficiently included all symbols, even symbols that were not desired. The second issue is that it did not handle inline functions correctly. These have been fixed.
Diffstat (limited to 'tester/covoar/covoar.cc')
-rw-r--r--tester/covoar/covoar.cc110
1 files changed, 55 insertions, 55 deletions
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index cbb0e4f..84d883a 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -222,6 +222,61 @@ int covoar(
if ( !projectName )
throw option_error( "project name -p" );
+ //
+ // Find the top of the BSP's build tree and if we have found the top
+ // check the executable is under the same path and BSP.
+ //
+ std::string buildPath;
+ std::string buildTarget;
+ std::string buildBSP;
+ createBuildPath(executablesToAnalyze,
+ buildPath,
+ buildTarget,
+ buildBSP);
+
+ //
+ // Use a command line target if provided.
+ //
+ if (!target.empty()) {
+ buildTarget = target;
+ }
+
+ if (Verbose) {
+ if (singleExecutable) {
+ std::cerr << "Processing a single executable and multiple coverage files"
+ << std::endl;
+ } else {
+ std::cerr << "Processing multiple executable/coverage file pairs" << std::endl;
+ }
+ std::cerr << "Coverage Format : " << format << std::endl
+ << "Target : " << buildTarget.c_str() << std::endl
+ << std::endl;
+
+ // Process each executable/coverage file pair.
+ Executables::iterator eitr = executablesToAnalyze.begin();
+ for (const auto& cname : coverageFileNames) {
+ std::cerr << "Coverage file " << cname
+ << " for executable: " << (*eitr)->getFileName() << std::endl;
+ if (!singleExecutable)
+ eitr++;
+ }
+ }
+
+ //
+ // Create data to support analysis.
+ //
+
+ // Create data based on target.
+ TargetInfo = Target::TargetFactory( buildTarget );
+
+ // Create the set of desired symbols.
+ SymbolsToAnalyze = new Coverage::DesiredSymbols();
+
+ //
+ // Read symbol configuration file and load needed symbols.
+ //
+ SymbolsToAnalyze->load( symbolSet, buildTarget, buildBSP, Verbose );
+
// If a single executable was specified, process the remaining
// arguments as coverage file names.
if (singleExecutable) {
@@ -294,61 +349,6 @@ int covoar(
if (executablesToAnalyze.size() != coverageFileNames.size())
throw rld::error( "executables and coverage name size mismatch", "covoar" );
- //
- // Find the top of the BSP's build tree and if we have found the top
- // check the executable is under the same path and BSP.
- //
- std::string buildPath;
- std::string buildTarget;
- std::string buildBSP;
- createBuildPath(executablesToAnalyze,
- buildPath,
- buildTarget,
- buildBSP);
-
- //
- // Use a command line target if provided.
- //
- if (!target.empty()) {
- buildTarget = target;
- }
-
- if (Verbose) {
- if (singleExecutable) {
- std::cerr << "Processing a single executable and multiple coverage files"
- << std::endl;
- } else {
- std::cerr << "Processing multiple executable/coverage file pairs" << std::endl;
- }
- std::cerr << "Coverage Format : " << format << std::endl
- << "Target : " << buildTarget.c_str() << std::endl
- << std::endl;
-
- // Process each executable/coverage file pair.
- Executables::iterator eitr = executablesToAnalyze.begin();
- for (const auto& cname : coverageFileNames) {
- std::cerr << "Coverage file " << cname
- << " for executable: " << (*eitr)->getFileName() << std::endl;
- if (!singleExecutable)
- eitr++;
- }
- }
-
- //
- // Create data to support analysis.
- //
-
- // Create data based on target.
- TargetInfo = Target::TargetFactory( buildTarget );
-
- // Create the set of desired symbols.
- SymbolsToAnalyze = new Coverage::DesiredSymbols();
-
- //
- // Read symbol configuration file and load needed symbols.
- //
- SymbolsToAnalyze->load( symbolSet, buildTarget, buildBSP, Verbose );
-
if ( Verbose )
std::cerr << "Analyzing " << SymbolsToAnalyze->set.size()
<< " symbols" << std::endl;