Skip to content

Commit

Permalink
Restore old findModuleByOffset interface in parallel with the new one.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Oct 31, 2016
1 parent 622956a commit c048f4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions symtabAPI/h/Symtab.h
Expand Up @@ -201,6 +201,7 @@ class SYMTAB_EXPORT Symtab : public LookupInterface,

bool getAllModules(std::vector<Module *>&ret);
bool findModuleByOffset(std::set<Module *>& ret, Offset off);
bool findModuleByOffset(Module *& ret, Offset off);
bool findModuleByName(Module *&ret, const std::string name);
Module *getDefaultModule();

Expand Down
10 changes: 10 additions & 0 deletions symtabAPI/src/Symtab-lookup.C
Expand Up @@ -385,6 +385,16 @@ bool module_less(Module* lhs, Module* rhs)
if(rhs == NULL) return true;
return lhs->addr() < rhs->addr();
}
bool Symtab::findModuleByOffset(Module *&ret, Offset off)
{
std::set<ModRange*> mods;
mod_lookup()->find(off, mods);
if(!mods.empty())
{
ret = (*mods.begin())->mod();
}
return mods.empty();
}


bool Symtab::findModuleByOffset(std::set<Module *>&ret, Offset off)
Expand Down

0 comments on commit c048f4d

Please sign in to comment.