From 6a4859e627fa10690741d36b2f1c39a1c4d6cc3a Mon Sep 17 00:00:00 2001 From: Cillian O'Donnell Date: Sat, 26 Aug 2017 09:15:56 +0100 Subject: covoar: Use rld tempfile and add signals to clean up in event of crash. Use rld tempfile for temporary files and add fatal signal handling to clean them up in the event of a crash. --- tester/covoar/ObjdumpProcessor.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'tester/covoar/ObjdumpProcessor.h') diff --git a/tester/covoar/ObjdumpProcessor.h b/tester/covoar/ObjdumpProcessor.h index 283ac73..c75755d 100644 --- a/tester/covoar/ObjdumpProcessor.h +++ b/tester/covoar/ObjdumpProcessor.h @@ -13,6 +13,8 @@ #include "ExecutableInfo.h" #include "TargetBase.h" +#include "rld-process.h" + namespace Coverage { /*! @class ObjdumpProcessor @@ -74,11 +76,11 @@ namespace Coverage { */ typedef std::list objdumpLines_t; - + /*! * This object defines a list of instruction addresses * that will be extracted from the objdump file. - */ + */ typedef std::list objdumpFile_t; /*! @@ -96,17 +98,21 @@ namespace Coverage { ); /*! - * This method returns a file pointer to the objdump file - * for the given file name. + * This method fills a tempfile with the .text section of objdump + * for the given file name. */ - FILE* getFile( std::string fileName ); + void getFile( std::string fileName, + rld::process::tempfile& dmp, + rld::process::tempfile& err ); /*! - * This method fills the objdumpList list with all the + * This method fills the objdumpList list with all the * instruction addresses in the object dump file. */ void loadAddressTable ( - ExecutableInfo* const executableInformation + ExecutableInfo* const executableInformation, + rld::process::tempfile& dmp, + rld::process::tempfile& err ); /*! @@ -114,23 +120,25 @@ namespace Coverage { * the specified executable. */ void load( - ExecutableInfo* const executableInformation + ExecutableInfo* const executableInformation, + rld::process::tempfile& dmp, + rld::process::tempfile& err ); /*! - * This method returns the next address in othe objdumpList. + * This method returns the next address in the objdumpList. */ uint32_t getAddressAfter( uint32_t address ); /*! - * This method returns true if the instrucation is + * This method returns true if the instruction is * an instruction that results in a code branch, otherwise * it returns false. */ bool IsBranch( const char *instruction ); /*! - * This method returns true if the instruction from + * This method returns true if the instruction from * the given line in the objdmp file is a branch instruction, * otherwise it returns false. */ -- cgit v1.2.3