diff options
author | Chris Johns <chrisj@rtems.org> | 2018-05-08 15:09:39 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-06-15 15:54:25 +1000 |
commit | fb987e82be3e3d025875b6c39c92384c3e8a1c3e (patch) | |
tree | 31fb132f74f5787f0907551eda2e891435b1593f /tester/covoar/ExecutableInfo.h | |
parent | rtemstoolkit: Add libdwarf C++ interface. (diff) | |
download | rtems-tools-fb987e82be3e3d025875b6c39c92384c3e8a1c3e.tar.bz2 |
covoar: Use DWARF to map addresses to source files and lines.
Diffstat (limited to 'tester/covoar/ExecutableInfo.h')
-rw-r--r-- | tester/covoar/ExecutableInfo.h | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/tester/covoar/ExecutableInfo.h b/tester/covoar/ExecutableInfo.h index 20ea9bf..9106db3 100644 --- a/tester/covoar/ExecutableInfo.h +++ b/tester/covoar/ExecutableInfo.h @@ -11,6 +11,10 @@ #include <stdint.h> #include <string> +#include <rld-dwarf.h> +#include <rld-files.h> +#include <rld-symbols.h> + #include "CoverageMapBase.h" #include "SymbolTable.h" @@ -67,14 +71,14 @@ namespace Coverage { * * @return Returns the executable's file name */ - const std::string& getFileName( void ) const; + const std::string getFileName( void ) const; /*! * This method returns the library name associated with the executable. * * @return Returns the executable's library name */ - const std::string& getLibraryName( void ) const; + const std::string getLibraryName( void ) const; /*! * This method returns the load address of the dynamic library @@ -88,7 +92,7 @@ namespace Coverage { * * @return Returns a pointer to the symbol table. */ - SymbolTable* getSymbolTable( void ) const; + SymbolTable* getSymbolTable( void ); /*! * This method creates a coverage map for the specified symbol. @@ -108,6 +112,15 @@ namespace Coverage { ); /*! + * This method gets the source location, the file and line number given an + * address. + */ + void getSourceAndLine( + const unsigned int address, + std::string& location + ); + + /*! * This method indicates whether a dynamic library has been * associated with the executable. * @@ -132,15 +145,25 @@ namespace Coverage { private: /*! - * This map associates a symbol with its coverage map. + * The ELF executable. */ - typedef std::map<std::string, CoverageMapBase *> coverageMaps_t; - coverageMaps_t coverageMaps; + rld::files::object executable; /*! - * This member variable contains the name of the executable. + * The DWARF data to the ELF executable. + */ + rld::dwarf::file debug; + + /*! + * The executable's symbol table. + */ + rld::symbols::table symbols; + + /*! + * This map associates a symbol with its coverage map. */ - std::string executableName; + typedef std::map<std::string, CoverageMapBase *> CoverageMaps; + CoverageMaps coverageMaps; /*! * This member variable contains the name of a dynamic library @@ -158,7 +181,7 @@ namespace Coverage { * This member variable contains a pointer to the symbol table * of the executable or library. */ - SymbolTable* theSymbolTable; + SymbolTable theSymbolTable; }; } |