summaryrefslogtreecommitdiffstats
path: root/tester/covoar
diff options
context:
space:
mode:
authorRyan Long <ryan.long@oarcorp.com>2021-07-27 17:16:14 -0400
committerJoel Sherrill <joel@rtems.org>2021-08-03 15:56:53 -0500
commit283e6fd072af85d5f2edab3cb98f2a94b1701a93 (patch)
treee09f1c5cc40fcaadafede09961d3b2711792c503 /tester/covoar
parentRemove Verbose global variable (diff)
downloadrtems-tools-283e6fd072af85d5f2edab3cb98f2a94b1701a93.tar.bz2
Remove dynamicLibrary global variable
- Replaced dynamicLibrary in app_common with local variables - Changed data type to string - Changed conditionals to reflect this
Diffstat (limited to 'tester/covoar')
-rw-r--r--tester/covoar/ExecutableInfo.cc10
-rw-r--r--tester/covoar/ExecutableInfo.h6
-rw-r--r--tester/covoar/TraceConverter.cc5
-rw-r--r--tester/covoar/app_common.cc1
-rw-r--r--tester/covoar/app_common.h1
-rw-r--r--tester/covoar/covoar.cc9
6 files changed, 16 insertions, 16 deletions
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index a6184e7..9c3031e 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -18,18 +18,18 @@
namespace Coverage {
ExecutableInfo::ExecutableInfo(
- const char* const theExecutableName,
- const char* const theLibraryName,
- bool verbose
+ const char* const theExecutableName,
+ const std::string& theLibraryName,
+ bool verbose
) : fileName(theExecutableName),
loadAddress(0)
{
- if (theLibraryName != nullptr)
+ if ( !theLibraryName.empty() )
libraryName = theLibraryName;
if (verbose) {
std::cerr << "Loading executable " << theExecutableName;
- if (theLibraryName != nullptr)
+ if ( !theLibraryName.empty() )
std::cerr << " (" << theLibraryName << ')';
std::cerr << std::endl;
}
diff --git a/tester/covoar/ExecutableInfo.h b/tester/covoar/ExecutableInfo.h
index 1f977a0..851a59d 100644
--- a/tester/covoar/ExecutableInfo.h
+++ b/tester/covoar/ExecutableInfo.h
@@ -43,9 +43,9 @@ namespace Coverage {
* @param[in] verbose specifies whether to be verbose with output
*/
ExecutableInfo(
- const char* const theExecutableName,
- const char* const theLibraryName = NULL,
- bool verbose = false
+ const char* const theExecutableName,
+ const std::string& theLibraryName = "",
+ bool verbose = false
);
/*!
diff --git a/tester/covoar/TraceConverter.cc b/tester/covoar/TraceConverter.cc
index 89e0736..c997702 100644
--- a/tester/covoar/TraceConverter.cc
+++ b/tester/covoar/TraceConverter.cc
@@ -91,6 +91,7 @@ int main(
rld::process::tempfile err( ".err" );
Coverage::ObjdumpProcessor objdumpProcessor;
bool verbose = false;
+ std::string dynamicLibrary;
setup_signals();
@@ -130,13 +131,13 @@ int main(
// Create toolnames.
TargetInfo = Target::TargetFactory( cpuname );
- if (dynamicLibrary)
+ if ( !dynamicLibrary.empty() )
executableInfo = new Coverage::ExecutableInfo( executable, dynamicLibrary );
else
executableInfo = new Coverage::ExecutableInfo( executable );
// If a dynamic library was specified, determine the load address.
- if (dynamicLibrary)
+ if ( !dynamicLibrary.empty() )
executableInfo->setLoadAddress(
objdumpProcessor.determineLoadAddress( executableInfo )
);
diff --git a/tester/covoar/app_common.cc b/tester/covoar/app_common.cc
index 9dfe81e..587af1a 100644
--- a/tester/covoar/app_common.cc
+++ b/tester/covoar/app_common.cc
@@ -60,7 +60,6 @@ Coverage::DesiredSymbols* SymbolsToAnalyze = NULL;
const char* outputDirectory = ".";
bool BranchInfoAvailable = false;
Target::TargetBase* TargetInfo = NULL;
-const char* dynamicLibrary = NULL;
const char* projectName = NULL;
char inputBuffer[MAX_LINE_LENGTH];
char inputBuffer2[MAX_LINE_LENGTH];
diff --git a/tester/covoar/app_common.h b/tester/covoar/app_common.h
index ac66eda..6cb8577 100644
--- a/tester/covoar/app_common.h
+++ b/tester/covoar/app_common.h
@@ -16,7 +16,6 @@ extern Coverage::DesiredSymbols* SymbolsToAnalyze;
extern const char* outputDirectory;
extern bool BranchInfoAvailable;
extern Target::TargetBase* TargetInfo;
-extern const char* dynamicLibrary;
extern const char* projectName;
#define MAX_LINE_LENGTH 512
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 9c88b00..3894867 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -177,6 +177,7 @@ int covoar(
Coverage::Explanations allExplanations;
Coverage::ObjdumpProcessor objdumpProcessor;
bool verbose = false;
+ std::string dynamicLibrary;
//
// Process command line options.
@@ -303,13 +304,13 @@ int covoar(
// If there was at least one coverage file, create the
// executable information.
if (!coverageFileNames.empty()) {
- if (dynamicLibrary) {
+ if ( !dynamicLibrary.empty() ) {
executableInfo = new Coverage::ExecutableInfo(
singleExecutable, dynamicLibrary, verbose
);
} else {
executableInfo = new Coverage::ExecutableInfo(
- singleExecutable, nullptr, verbose
+ singleExecutable, "", verbose
);
}
@@ -333,7 +334,7 @@ int covoar(
<< std::endl;
} else {
executableInfo = new Coverage::ExecutableInfo(
- argv[i], nullptr, verbose
+ argv[i], "", verbose
);
executablesToAnalyze.push_back( executableInfo );
coverageFileNames.push_back( coverageFileName );
@@ -373,7 +374,7 @@ int covoar(
<< std::endl;
// If a dynamic library was specified, determine the load address.
- if (dynamicLibrary) {
+ if ( !dynamicLibrary.empty() ) {
exe->setLoadAddress( objdumpProcessor.determineLoadAddress( exe ) );
}