From 463831374ce73e6792c6fc6c02e705cf3b8fc349 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 15 Sep 2020 13:10:56 +1000 Subject: linker/exeinfo: Optionally output full flags when listing object files - Start adding support to dump configuration tables --- rtemstoolkit/rld-dwarf.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) (limited to 'rtemstoolkit/rld-dwarf.h') diff --git a/rtemstoolkit/rld-dwarf.h b/rtemstoolkit/rld-dwarf.h index 030be3a..45fbab1 100644 --- a/rtemstoolkit/rld-dwarf.h +++ b/rtemstoolkit/rld-dwarf.h @@ -276,6 +276,59 @@ namespace rld dwarf_offset die_offset; }; + /** + * Variable. + */ + class variable + { + public: + + variable (file& debug, debug_info_entry& die); + variable (const variable& orig); + ~variable (); + + /** + * Get the name of the variable. + */ + std::string name () const; + + /** + * Is the variable external? + */ + bool is_external () const; + + /** + * Is this just a declaration? + */ + bool is_declaration () const; + + /** + * Size of the variable. + */ + size_t size () const; + + /** + * Assigment operator. + */ + variable& operator = (const variable& rhs); + + /** + * Dump the variable. + */ + void dump (std::ostream& out) const; + + private: + + file& debug; + bool external_; + bool declaration_; + std::string name_; + std::string decl_file_; + dwarf_unsigned decl_line_; + }; + + typedef std::vector < variable > variables; + /** * Function. */ @@ -619,6 +672,11 @@ namespace rld */ void load_types (); + /** + * Load the variables. + */ + void load_variables (); + /** * Load the functions. */ @@ -677,6 +735,7 @@ namespace rld private: + void load_variables (debug_info_entry& die); void load_functions (debug_info_entry& die); file& debug; ///< The DWARF debug handle. @@ -780,6 +839,11 @@ namespace rld */ void load_functions (); + /** + * Load the DWARF variables information. + */ + void load_variables (); + /** * Get the source location given an address. */ @@ -792,6 +856,11 @@ namespace rld */ void get_producer_sources (producer_sources& producers); + /** + * Get the variable given a name. Raises an exception if not found. + */ + variable& get_variable (std::string& name); + /** * Does the function exist. */ -- cgit v1.2.3