#include <symbols.h>
Public Types | |
typedef t_symbols::const_iterator | iterator |
Public Methods | |
Symbols () | |
std::pair< iterator, iterator > | operator[] (vma_t address) const |
Return names at a given address. More... | |
void | insert (const std::string &name, vma_t address) |
Add an api entry. More... | |
vma_t | GetNextValid (vma_t address) const |
Return next valid address where an api is located. More... | |
bool | IsValid (vma_t address) const |
Are there an api at given address. More... | |
Private Types | |
typedef std::set< Symbol, std::less< Symbol > > | t_symbols |
Private Attributes | |
t_symbols | symbols |
Definition at line 34 of file symbols.h.
|
Definition at line 55 of file symbols.h. Referenced by GetNextValid(), and operator[](). |
|
|
|
Definition at line 38 of file symbols.cpp.
00039 { 00040 } |
|
Return next valid address where an api is located.
Definition at line 76 of file symbols.cpp. References _PRG_ASSERT, iterator, symbols, and vma_t. Referenced by CodeParser::Parse().
00077 { 00078 iterator i = symbols.lower_bound(Symbol(address+1,"")); 00079 if ( i == symbols.end() ) 00080 return 0; 00081 _PRG_ASSERT( (*i).address > address ); 00082 return (*i).address; 00083 } |
|
Add an api entry.
Definition at line 71 of file symbols.cpp. References symbols, and vma_t. Referenced by SymbolsAddImport().
00072 { 00073 symbols.insert(Symbol(address,name)); 00074 } |
|
Are there an api at given address.
Definition at line 63 of file symbols.cpp. References vma_t. Referenced by CodeParser::IsApiReference().
00064 { 00065 pair<iterator,iterator> apis = (*this)[address]; 00066 if ( apis.first != apis.second ) 00067 return true; 00068 return false; 00069 } |
|
Return names at a given address.
Definition at line 43 of file symbols.cpp. References _DEBUG_, _PRG_ASSERT, iterator, symbols, and vma_t.
00044 { 00045 iterator begin = symbols.lower_bound(Symbol(address,"")); 00046 iterator end = begin; 00047 00048 // usually do one loop, so do not use strange method 00049 for(; end != symbols.end() ; ++end) 00050 if ( (*end).address != address ) 00051 break; 00052 _PRG_ASSERT( begin == symbols.end() || (*begin).address >= address ); 00053 _DEBUG_(iterator tmp = begin); 00054 _PRG_ASSERT( tmp == symbols.begin() || (*--tmp).address < address ); 00055 _PRG_ASSERT( end == symbols.end() || begin == end || (*end).address > address ); 00056 if( end == symbols.end() || begin == end || (*end).address > address ) ; 00057 else { cerr << "Address=" << address << " end Address=" << (*end).address << " end Name=" << (*end).name << endl; _PRG_ASSERT(0); } 00058 _DEBUG_( tmp = end ); 00059 _PRG_ASSERT( tmp == symbols.begin() || begin == end || (*--tmp).address == address ); 00060 return pair<iterator,iterator>(begin,end); 00061 } |
|
Definition at line 53 of file symbols.h. Referenced by GetNextValid(), insert(), and operator[](). |