diff options
author | Alex White <alex.white@oarcorp.com> | 2021-04-30 14:26:02 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-06-17 16:00:08 -0500 |
commit | a88be93a882379b59491e6661fad7dab0b358933 (patch) | |
tree | 33ad8004a53237185360dab3eab80cc713f4a1e5 /tester/covoar/ExecutableInfo.cc | |
parent | tester: Add a72_lp64_qemu.ini (diff) | |
download | rtems-tools-a88be93a882379b59491e6661fad7dab0b358933.tar.bz2 |
covoar: Store only the file name in ExecutableInfo
This changes the ExecutableInfo class to only store the executable
file's name rather than an entire instance of rld::files::object. This
allows the rld::files::object to be cleaned up in the ExecutableInfo
constructor.
Updates #4383
Diffstat (limited to 'tester/covoar/ExecutableInfo.cc')
-rw-r--r-- | tester/covoar/ExecutableInfo.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc index fc368ce..861e60d 100644 --- a/tester/covoar/ExecutableInfo.cc +++ b/tester/covoar/ExecutableInfo.cc @@ -21,7 +21,7 @@ namespace Coverage { const char* const theExecutableName, const char* const theLibraryName, bool verbose - ) : executable(theExecutableName), + ) : fileName(theExecutableName), loadAddress(0) { if (theLibraryName != nullptr) @@ -34,6 +34,8 @@ namespace Coverage { std::cerr << std::endl; } + rld::files::object executable(theExecutableName); + executable.open(); executable.begin(); executable.load_symbols(symbols); @@ -82,8 +84,6 @@ namespace Coverage { } } catch (...) { debug.end(); - executable.end(); - executable.close(); throw; } @@ -95,8 +95,6 @@ namespace Coverage { ExecutableInfo::~ExecutableInfo() { debug.end(); - executable.end(); - executable.close(); } void ExecutableInfo::dumpCoverageMaps( void ) { @@ -132,9 +130,9 @@ namespace Coverage { return aCoverageMap; } - const std::string ExecutableInfo::getFileName ( void ) const + const std::string& ExecutableInfo::getFileName ( void ) const { - return executable.name().full(); + return fileName; } const std::string ExecutableInfo::getLibraryName( void ) const |