mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 05:54:50 +08:00
Use full path when loading SourceLevelDebugger library
Change-Id: I27f7ee2b8944b9890ab4b141c06e9c2f0a8dffb1 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
17b2a29945
commit
4df533f63a
@@ -23,6 +23,11 @@ OsLibrary *OsLibrary::load(const std::string &name) {
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
const std::string OsLibrary::createFullSystemPath(const std::string &name) {
|
||||
return name;
|
||||
}
|
||||
|
||||
namespace Linux {
|
||||
|
||||
OsLibrary::OsLibrary(const std::string &name) {
|
||||
|
||||
@@ -32,6 +32,7 @@ class OsLibrary {
|
||||
virtual ~OsLibrary() = default;
|
||||
|
||||
static OsLibrary *load(const std::string &name);
|
||||
static const std::string createFullSystemPath(const std::string &name);
|
||||
|
||||
ConvertibleProcAddr operator[](const std::string &name) {
|
||||
return ConvertibleProcAddr{getProcAddress(name)};
|
||||
|
||||
@@ -19,9 +19,20 @@ OsLibrary *OsLibrary::load(const std::string &name) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
const std::string OsLibrary::createFullSystemPath(const std::string &name) {
|
||||
CHAR buff[MAX_PATH];
|
||||
UINT ret = 0;
|
||||
ret = Windows::OsLibrary::getSystemDirectoryA(buff, MAX_PATH);
|
||||
buff[ret] = '\\';
|
||||
buff[ret + 1] = 0;
|
||||
strncat_s(&buff[0], sizeof(buff), name.c_str(), _TRUNCATE);
|
||||
return std::string(buff);
|
||||
}
|
||||
|
||||
namespace Windows {
|
||||
decltype(&LoadLibraryExA) OsLibrary::loadLibraryExA = LoadLibraryExA;
|
||||
decltype(&GetModuleFileNameA) OsLibrary::getModuleFileNameA = GetModuleFileNameA;
|
||||
decltype(&GetSystemDirectoryA) OsLibrary::getSystemDirectoryA = GetSystemDirectoryA;
|
||||
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
__inline HINSTANCE GetModuleHINSTANCE() { return (HINSTANCE)&__ImageBase; }
|
||||
|
||||
@@ -24,6 +24,7 @@ class OsLibrary : public NEO::OsLibrary {
|
||||
|
||||
bool isLoaded();
|
||||
void *getProcAddress(const std::string &procName);
|
||||
static decltype(&GetSystemDirectoryA) getSystemDirectoryA;
|
||||
|
||||
protected:
|
||||
HMODULE loadDependency(const std::string &dependencyFileName) const;
|
||||
|
||||
Reference in New Issue
Block a user