diff options
author | Nathan Binkert <binkertn@umich.edu> | 2005-10-12 17:18:10 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2005-10-12 17:18:10 -0400 |
commit | 67b807d90738e238a617e818a2d13c6cf2161a6d (patch) | |
tree | 7c627bd1a2967b0e2be7fe5fa5a4d2919bbcacb0 /base/loader/symtab.cc | |
parent | 17b1c8f90d49bca067f4557940d443c379aa4b8a (diff) | |
download | gem5-67b807d90738e238a617e818a2d13c6cf2161a6d.tar.xz |
Clean up symbol table access functions and make it
possible to inline them. The symbol table is heavily
used in the stacktrace code and the faster access
functions should help out.
base/loader/symtab.cc:
Put these in the header file since they are simple and can
be inlined.
base/loader/symtab.hh:
Move the various findFoo functions to the header file so they
can be inlined. Add findNearestAddr functions that don't
return the symbol. This is so you can figure out what
function you're in based on the symbol table, but not waste
time copying out the symbol name if you don't need it.
--HG--
extra : convert_revision : 00cac40a79b0641a70c5ec7d9838fa0ec505c6a1
Diffstat (limited to 'base/loader/symtab.cc')
-rw-r--r-- | base/loader/symtab.cc | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/base/loader/symtab.cc b/base/loader/symtab.cc index 98dad01c1..e4590ac62 100644 --- a/base/loader/symtab.cc +++ b/base/loader/symtab.cc @@ -95,44 +95,3 @@ SymbolTable::load(const string &filename) return true; } - -bool -SymbolTable::findNearestSymbol(Addr address, string &symbol, - Addr &sym_address, Addr &next_sym_address) const -{ - // find first key *larger* than desired address - ATable::const_iterator i = addrTable.upper_bound(address); - - // if very first key is larger, we're out of luck - if (i == addrTable.begin()) - return false; - - next_sym_address = i->first; - --i; - sym_address = i->first; - symbol = i->second; - - return true; -} - -bool -SymbolTable::findSymbol(Addr address, string &symbol) const -{ - ATable::const_iterator i = addrTable.find(address); - if (i == addrTable.end()) - return false; - - symbol = (*i).second; - return true; -} - -bool -SymbolTable::findAddress(const string &symbol, Addr &address) const -{ - STable::const_iterator i = symbolTable.find(symbol); - if (i == symbolTable.end()) - return false; - - address = (*i).second; - return true; -} |