From a88be93a882379b59491e6661fad7dab0b358933 Mon Sep 17 00:00:00 2001 From: Alex White Date: Fri, 30 Apr 2021 14:26:02 -0500 Subject: 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 --- tester/covoar/ExecutableInfo.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tester/covoar/ExecutableInfo.cc') 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 -- cgit v1.2.3