Source Level Debugger - debugger library interface

- interface to debugger dynamic library
- code is included when source level debugger header exists,
otherwise implementation is exluded from build
- unit tests do not load real dynamic library,
instead test version (DebbugerLibrary) of OsLibrary is used.

Change-Id: Id3229c77963352e8001043ee41b7d48c6b180a59
This commit is contained in:
Hoppe, Mateusz
2018-04-20 14:44:14 +02:00
committed by sys_ocldev
parent b79be3dafb
commit efda64eb4a
27 changed files with 849 additions and 10 deletions

View File

@@ -44,7 +44,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_null_device.h
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/options.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.h
@@ -55,6 +54,7 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_linux.h
${CMAKE_CURRENT_SOURCE_DIR}/print.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_linux.cpp
)
if(UNIX)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -42,4 +42,8 @@ bool OSInterface::are64kbPagesEnabled() {
return osEnabled64kbPages;
}
uint32_t OSInterface::getDeviceHandle() const {
return 0;
}
} // namespace OCLRT

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 - 2018, Intel Corporation
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -20,15 +20,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "compiler.config.h"
#include "runtime/os_interface/os_library.h"
#include "runtime/source_level_debugger/source_level_debugger.h"
namespace Os {
// Compiler library names
const char *frontEndDllName = FCL_LIBRARY_NAME;
const char *igcDllName = IGC_LIBRARY_NAME;
const char *libvaDllName = "libva.so.2";
const char *sysFsPciPath = "/sys/bus/pci/devices/";
const char *tbxLibName = "libtbxAccess.so";
}
const char *OCLRT::SourceLevelDebugger::dllName = "libigfxdbgxchg64.so";

View File

@@ -39,6 +39,7 @@ class OSInterface {
unsigned int getHwContextId() const;
static bool osEnabled64kbPages;
static bool are64kbPagesEnabled();
unsigned int getDeviceHandle() const;
protected:
OSInterfaceImpl *osInterfaceImpl = nullptr;

View File

@@ -41,7 +41,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/kmdaf_listener${KMDAF_FILE_SUFFIX}.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kmdaf_listener.h
${CMAKE_CURRENT_SOURCE_DIR}/options.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.h
@@ -54,6 +53,7 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win.h
${CMAKE_CURRENT_SOURCE_DIR}/print.cpp
${CMAKE_CURRENT_SOURCE_DIR}/registry_reader.h
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_windows.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sys_calls.h
${CMAKE_CURRENT_SOURCE_DIR}/thk_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/wddm.cpp

View File

@@ -41,6 +41,10 @@ uint32_t OSInterface::getHwContextId() const {
return osInterfaceImpl->getHwContextId();
}
uint32_t OSInterface::getDeviceHandle() const {
return static_cast<uint32_t>(osInterfaceImpl->getDeviceHandle());
}
OSInterface::OSInterfaceImpl::OSInterfaceImpl() {
wddm = nullptr;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -20,14 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
namespace Os {
#if defined(_WIN64)
const char *frontEndDllName = "igdfcl64.dll";
const char *igcDllName = "igc64.dll";
#else
const char *frontEndDllName = "igdfcl32.dll";
const char *igcDllName = "igc32.dll";
#endif
#include "runtime/source_level_debugger/source_level_debugger.h"
const char *gdiDllName = "gdi32.dll";
}
#if defined(_WIN64)
const char *OCLRT::SourceLevelDebugger::dllName = "igfxdbgxchg64.dll";
#else
const char *OCLRT::SourceLevelDebugger::dllName = "igfxdbgxchg.dll";
#endif