Skip to content

Commit

Permalink
Fix debugger not working in the free version. Fix Vector35#576
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed May 6, 2024
1 parent ed886e7 commit 97dc561
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/adapters/dbgengadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,11 @@ std::string DbgEngAdapter::GetDbgEngPath(const std::string& arch)
return "";
}

// If the user does not specify a path (the default case), find the one from the %APPDATA% or %PROGRAMDATA%
char debuggerPath[MAX_PATH];
HMODULE handle = GetModuleHandleA("debuggercore.dll");
if (handle && (GetModuleFileNameA(handle, debuggerPath, MAX_PATH)))
{
auto debuggerRoot = filesystem::path(debuggerPath).parent_path() / "dbgeng" / arch;
if (IsValidDbgEngPaths(debuggerRoot.string()))
return debuggerRoot.string();
}
// If the user does not specify a path (the default case), find the one from the plugins/dbgeng/arch
auto debuggerRoot = filesystem::path(GetBundledPluginDirectory()) / "dbgeng" / arch;
if (IsValidDbgEngPaths(debuggerRoot.string()))
return debuggerRoot.string();

return "";
}

Expand Down Expand Up @@ -165,8 +161,7 @@ bool DbgEngAdapter::LoadDngEngLibraries()
if (enginePath.empty())
{
LogWarn("The debugger cannot find the path for the DbgEng DLLs. "
"If you have set debugger.x64dbgEngPath, check its correctness; if you have not set it, "
"reinstall the DbgEng redistributable");
"If you have set debugger.x64dbgEngPath, check if it valid");
return false;
}
LogDebug("DbgEng libraries in path %s", enginePath.c_str());
Expand Down

0 comments on commit 97dc561

Please sign in to comment.