summaryrefslogtreecommitdiffstats
path: root/covoar/SymbolTable.h
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2010-05-24 20:07:09 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2010-05-24 20:07:09 +0000
commita518bc5b1a39e27a75bb5510ebf272c7658144b1 (patch)
tree5c8e7bcfb36f333f88f94673627addd5fcd7969d /covoar/SymbolTable.h
parent2010-05-24 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff)
downloadrtems-testing-a518bc5b1a39e27a75bb5510ebf272c7658144b1.tar.bz2
2010-05-24 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* covoar/05_ascending.gif, covoar/05_descending.gif, covoar/05_unsorted.gif, covoar/ConfigFile.cc, covoar/ConfigFile.h, covoar/CoverageFactory.cc, covoar/CoverageFactory.h, covoar/CoverageMap.cc, covoar/CoverageMap.h, covoar/CoverageMapBase.cc, covoar/CoverageMapBase.h, covoar/CoverageRanges.cc, covoar/CoverageRanges.h, covoar/CoverageReaderBase.cc, covoar/CoverageReaderBase.h, covoar/CoverageReaderQEMU.cc, covoar/CoverageReaderQEMU.h, covoar/CoverageReaderRTEMS.cc, covoar/CoverageReaderRTEMS.h, covoar/CoverageReaderSkyeye.cc, covoar/CoverageReaderSkyeye.h, covoar/CoverageReaderTSIM.cc, covoar/CoverageReaderTSIM.h, covoar/CoverageWriterBase.cc, covoar/CoverageWriterBase.h, covoar/CoverageWriterRTEMS.cc, covoar/CoverageWriterRTEMS.h, covoar/CoverageWriterSkyeye.cc, covoar/CoverageWriterSkyeye.h, covoar/CoverageWriterTSIM.cc, covoar/CoverageWriterTSIM.h, covoar/DesiredSymbols.cc, covoar/DesiredSymbols.h, covoar/ExecutableInfo.cc, covoar/ExecutableInfo.h, covoar/Explanations.cc, covoar/Explanations.h, covoar/Makefile, covoar/ObjdumpProcessor.cc, covoar/ObjdumpProcessor.h, covoar/ReportsBase.cc, covoar/ReportsBase.h, covoar/ReportsHtml.cc, covoar/ReportsHtml.h, covoar/ReportsText.cc, covoar/ReportsText.h, covoar/SymbolTable.cc, covoar/SymbolTable.h, covoar/TargetBase.cc, covoar/TargetBase.h, covoar/TargetFactory.cc, covoar/TargetFactory.h, covoar/Target_arm.cc, covoar/Target_arm.h, covoar/Target_i386.cc, covoar/Target_i386.h, covoar/Target_lm32.cc, covoar/Target_lm32.h, covoar/Target_m68k.cc, covoar/Target_m68k.h, covoar/Target_powerpc.cc, covoar/Target_powerpc.h, covoar/Target_sparc.cc, covoar/Target_sparc.h, covoar/TraceConverter.cc, covoar/TraceList.cc, covoar/TraceList.h, covoar/TraceReaderBase.cc, covoar/TraceReaderBase.h, covoar/TraceReaderLogQEMU.cc, covoar/TraceReaderLogQEMU.h, covoar/TraceWriterBase.cc, covoar/TraceWriterBase.h, covoar/TraceWriterQEMU.cc, covoar/TraceWriterQEMU.h, covoar/app_common.cc, covoar/app_common.h, covoar/configfile_test.cc, covoar/coverage_converter.cc, covoar/covmerge.cc, covoar/covoar.cc, covoar/covoar.css, covoar/filter.gif, covoar/qemu-dump-trace.c, covoar/qemu-log.h, covoar/qemu-traces.h, covoar/rtemscov_header.h, covoar/skyeye_header.h, covoar/table.js: New files.
Diffstat (limited to 'covoar/SymbolTable.h')
-rw-r--r--covoar/SymbolTable.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/covoar/SymbolTable.h b/covoar/SymbolTable.h
new file mode 100644
index 0000000..ac8ac69
--- /dev/null
+++ b/covoar/SymbolTable.h
@@ -0,0 +1,119 @@
+/*
+ * $Id$
+ */
+
+/*! @file SymbolTable.h
+ * @brief SymbolTable Specification
+ *
+ * This file contains the specification of the SymbolTable class.
+ */
+
+#ifndef __SYMBOLTABLE_H__
+#define __SYMBOLTABLE_H__
+
+#include <stdint.h>
+#include <string>
+#include <map>
+
+namespace Coverage {
+
+ /*! @class SymbolTable
+ *
+ * This class maintains information for each desired symbol within an
+ * executable. A desired symbol is a symbol for which analysis is to
+ * be performed.
+ */
+ class SymbolTable {
+
+ public:
+
+ /*!
+ * This structure defines the information kept for each symbol.
+ */
+ typedef struct {
+ uint32_t startingAddress;
+ uint32_t length;
+ } symbolInfo;
+
+ /*!
+ * This method constructs a SymbolTable instance.
+ */
+ SymbolTable();
+
+ /*!
+ * This method destructs a SymbolTable instance.
+ */
+ virtual ~SymbolTable();
+
+ /*!
+ * This method adds the specified symbol information to the
+ * symbol table.
+ *
+ * @param[in] symbol specifies the symbol to add
+ * @param[in] start specifies the symbol's start address
+ * @param[in] length specifies the symbol's length
+ *
+ */
+ void addSymbol(
+ const std::string& symbol,
+ const uint32_t start,
+ const uint32_t length
+ );
+
+ /*!
+ * This method returns the symbol information for the specified symbol.
+ *
+ * @param[in] symbol specifies the symbol for which to obtain information
+ *
+ * @return Returns a pointer to the symbol information
+ */
+ symbolInfo* getInfo(
+ const std::string& symbol
+ );
+
+ /*!
+ * This method returns the length in bytes of the specified symbol.
+ *
+ * @param[in] symbol specifies the symbol for which to obtain the length
+ *
+ * @return Returns the length of the symbol
+ */
+ uint32_t getLength(
+ const std::string& symbol
+ );
+
+ /*!
+ * This method returns the symbol that contains the specified address.
+ *
+ * @param[in] address specifies the address for which to obtain the symbol
+ *
+ * @return Returns the symbol containing the address
+ */
+ std::string getSymbol(
+ uint32_t address
+ );
+
+ private:
+
+ /*!
+ * This map associates the end address of a symbol's address
+ * range with the symbol's address range definition.
+ */
+ typedef struct {
+ uint32_t low;
+ uint32_t high;
+ std::string symbol;
+ } symbol_entry_t;
+ typedef std::map< uint32_t, symbol_entry_t > contents_t;
+ contents_t contents;
+
+ /*!
+ * This map associates each symbol from an executable with
+ * the symbol's information.
+ */
+ typedef std::map<std::string, symbolInfo> info_t;
+ info_t info;
+
+ };
+}
+#endif