Skip to content

Commit

Permalink
fix: correctly use SymSearch function
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoessbauer committed Apr 3, 2019
1 parent ae71a78 commit 63ee854
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ManagedResolver/src/ProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,12 @@ namespace msr {
std::string strpath(symreq.path.data());
std::wstring wstrpath(strpath.begin(), strpath.end());

logger->debug("search symobls matching {} at {}", symreq.match.data(), (void*)symreq.base);
logger->debug("search symbols matching {} at {} - full: {}",
symreq.match.data(),
(void*)symreq.base,
symreq.full ? "no" : "yes");
if (symsearch(_phandle, symreq.base, 0, 0, symreq.match.data(), 0, SymbolMatchCallback,
(void*)&symbol_addrs, symreq.full ? SYMSEARCH_ALLITEMS : NULL))
(void*)&symbol_addrs, symreq.full ? SYMSEARCH_ALLITEMS : SYMSEARCH_GLOBALSONLY))
{
auto & symresp = _shmdriver->emplace<ipc::SymbolResponse>(ipc::SMDataID::SEARCHSYMS);
symresp.size = std::min(symbol_addrs.size(), symresp.adresses.size());
Expand Down
2 changes: 2 additions & 0 deletions drace-client/src/function-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ namespace drace {
// set to true if at least one function is wrapped
bool wrapped_some = false;
std::string modname(dr_module_preferred_name(mod));
// remove ".dll / .exe" part
modname.erase(modname.size() - 4);
for (const auto & name : syms) {
LOG_NOTICE(-1, "Search for %s", name.c_str());
if (method == Method::EXTERNAL_MPCR) {
Expand Down

0 comments on commit 63ee854

Please sign in to comment.