libcsdbg  1.28
C++ exception (and generic) stack trace debug library
symtab.hpp
Go to the documentation of this file.
1 #ifndef _CSDBG_SYMTAB
2 #define _CSDBG_SYMTAB 1
3 
10 #include "./chain.hpp"
11 #include "./symbol.hpp"
12 
13 namespace csdbg {
14 
27 class symtab: virtual public object
28 {
29 protected:
30 
31  /* Protected variables */
32 
39 public:
40 
41  /* Constructors, copy constructors and destructor */
42 
43  explicit symtab(const i8*, mem_addr_t = 0);
44 
45  symtab(const symtab&);
46 
47  virtual ~symtab();
48 
49  virtual symtab* clone() const;
50 
51 
52  /* Accessor methods */
53 
54  virtual const i8* path() const;
55 
56  virtual mem_addr_t base() const;
57 
58 
59  /* Operator overloading methods */
60 
61  virtual symtab& operator=(const symtab&);
62 
63 
64  /* Generic methods */
65 
66  virtual u32 size() const;
67 
68  virtual const i8* lookup(mem_addr_t) const;
69 
70  virtual bool exists(mem_addr_t) const;
71 
72  virtual symtab& foreach(void (*)(u32, symbol*)) const;
73 };
74 
75 }
76 
77 #endif
78 
virtual bool exists(mem_addr_t) const
Probe if a symbol exists.
Definition: symtab.cpp:301
This abstract class serves as the root of the class hierarchy tree.
Definition: object.hpp:17
This class represents a program/library function symbol.
Definition: symbol.hpp:17
virtual symtab & operator=(const symtab &)
Assignment operator.
Definition: symtab.cpp:239
Lightweight, templated, doubly-linked list (using XOR linking)
Definition: chain.hpp:33
virtual ~symtab()
Object destructor.
Definition: symtab.cpp:186
char i8
8-bit signed integer
Definition: config.hpp:72
mem_addr_t m_base
Load base address.
Definition: symtab.hpp:35
Class csdbg::chain definition and method implementation.
This class represents a program/library symbol table (symtab section)
Definition: symtab.hpp:27
Class csdbg::symbol definition.
virtual const i8 * lookup(mem_addr_t) const
Lookup an address to resolve a symbol.
Definition: symtab.cpp:281
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
virtual symtab * clone() const
Object virtual copy constructor.
Definition: symtab.cpp:202
virtual const i8 * path() const
Get the objective code file path.
Definition: symtab.cpp:213
chain< symbol > * m_table
Function symbol table.
Definition: symtab.hpp:37
virtual u32 size() const
Get the number of symbols.
Definition: symtab.cpp:264
unsigned long long mem_addr_t
64-bit memory address
Definition: config.hpp:120
i8 * m_path
Objective code file path.
Definition: symtab.hpp:33
virtual mem_addr_t base() const
Get the load base address.
Definition: symtab.cpp:224
symtab(const i8 *, mem_addr_t=0)
Object constructor.
Definition: symtab.cpp:22