Add source level debugger header from SDK

Change-Id: I9898ec8892798facb71ccae0547c894b6b5a0288
This commit is contained in:
Kowalczuk, Jakub
2018-11-14 18:21:54 +01:00
committed by sys_ocldev
parent 61e7ae9280
commit 344e92acfa
11 changed files with 210 additions and 86 deletions

View File

@@ -99,12 +99,10 @@ if(NOT KMDAF_HEADERS_DIR)
endif()
endif(NOT KMDAF_HEADERS_DIR)
if(NOT SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../internal/source_level_debugger/igfx_debug_interchange_types.h")
get_filename_component(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR "../internal/source_level_debugger/" ABSOLUTE)
message(STATUS "Source Level Debugger headers dir: ${SOURCE_LEVEL_DEBUGGER_HEADERS_DIR}")
endif()
endif(NOT SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
if(NOT DEFINED SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
get_filename_component(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/source_level_debugger/" ABSOLUTE)
message(STATUS "Source Level Debugger headers dir: ${SOURCE_LEVEL_DEBUGGER_HEADERS_DIR}")
endif()
get_filename_component(AUB_STREAM_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/aub_stream/headers" ABSOLUTE)
if(IS_DIRECTORY ${AUB_STREAM_HEADERS_DIR})

View File

@@ -36,5 +36,10 @@ _Currently no plan to implement. If interested in these features, please use SRB
* CL_MEM_SVM_FINE_GRAIN_BUFFER (if using unpatched i915) - _patch is WIP_
* Creation of OpenCL context spanning both CPU and GPU devices is currently not supported
### External components
* Driver contains header used in Source Level Debugger from Intel SDK for OpenCL version - 7.0.0.2568x64,
from: https://software.intel.com/en-us/intel-opencl , path to header in SDK: "include/"
___(*) Other names and brands my be claimed as property of others.___

View File

@@ -22,7 +22,7 @@ components:
internal:
branch: master
dest_dir: internal
revision: 0e8bf983674cf9e5508c880b13f4a8c797043d7b
revision: 6070a7007c702717fe8d793673e4218a3f993dee
type: git
kmdaf:
branch: kmdaf

View File

@@ -4,19 +4,11 @@
# SPDX-License-Identifier: MIT
#
if(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
set(RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.h
)
else()
set(RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.h
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_stubs.cpp
)
endif()
set(RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.h
)
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER})
set_property(GLOBAL PROPERTY RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER ${RUNTIME_SRCS_SOURCE_LEVEL_DEBUGGER})

View File

@@ -13,6 +13,8 @@
#include "runtime/os_interface/os_interface.h"
#include "lib_names.h"
#define IGFXDBG_CURRENT_VERSION 4
namespace OCLRT {
const char *SourceLevelDebugger::notifyNewDeviceSymbol = "notifyNewDevice";
const char *SourceLevelDebugger::notifySourceCodeSymbol = "notifySourceCode";

View File

@@ -1,52 +0,0 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/source_level_debugger/source_level_debugger.h"
namespace OCLRT {
const char *SourceLevelDebugger::dllName = "";
SourceLevelDebugger::SourceLevelDebugger(OsLibrary *library) {
debuggerLibrary.reset(library);
}
SourceLevelDebugger::~SourceLevelDebugger() {
}
SourceLevelDebugger *SourceLevelDebugger::create() {
return nullptr;
}
bool SourceLevelDebugger::isDebuggerActive() {
return false;
}
bool SourceLevelDebugger::notifyNewDevice(uint32_t deviceHandle) {
return false;
}
bool SourceLevelDebugger::notifyDeviceDestruction() {
return false;
}
bool SourceLevelDebugger::notifySourceCode(const char *sourceCode, size_t size, std::string &filename) const {
return false;
}
bool SourceLevelDebugger::isOptimizationDisabled() const {
return false;
}
bool SourceLevelDebugger::notifyKernelDebugData(const KernelInfo *kernelInfo) const {
return false;
}
bool SourceLevelDebugger::initialize(bool useLocalMemory) {
return false;
}
} // namespace OCLRT

View File

@@ -50,7 +50,8 @@ allowed_files = [
banned_paths = [
'scripts/tests/copyright/in',
'scripts/tests/copyright/out'
'scripts/tests/copyright/out',
'third_party'
]
cpp_sharp_lines = [

View File

@@ -0,0 +1,184 @@
/* BSD LICENSE
*
* Copyright(c) 2014-2016 Intel Corporation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(__DEBUG_NOTIFY_TYPES_H_INCLUDED__)
#define __DEBUG_NOTIFY_TYPES_H_INCLUDED__
typedef enum
{
IGFXDBG_SUCCESS = 0,
IGFXDBG_FAILURE = -1,
IGFXDBG_INVALID_VALUE = -2,
IGFXDBG_INVALID_VERSION = -3
} IgfxdbgRetVal;
#ifdef __cplusplus
namespace dbg_options
{
static const char DBG_OPTION_TRUE[] = "1";
static const char DBG_OPTION_FALSE[] = "0";
static const char DBG_OPTION_COMPILE_NO_OPT[] = "Compile_NO_OPT";
static const char DBG_OPTION_MONITOR_EOT[] = "eot";
static const char DBG_OPTION_STRICT_SOLIB_EVENT[] = "strict-solib-event";
}
#endif
typedef void* GfxDbgHandle;
typedef GfxDbgHandle CmDeviceHandle;
typedef GfxDbgHandle CmUmdDeviceHandle;
typedef GfxDbgHandle CmUmdProgramHandle;
typedef GfxDbgHandle GenRtProgramHandle;
typedef GfxDbgHandle GfxDeviceHandle;
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgVisaElfFileData
{
unsigned int version;
GenRtProgramHandle gph;
CmDeviceHandle dh;
const char* elfFileName;
const void* inMemoryBuffer;
unsigned int inMemorySize;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgVisaCodeLoadData
{
unsigned int version;
GenRtProgramHandle gph;
CmDeviceHandle dh;
const char* kernelNames;
unsigned kernelNamesSize;
const char* elfFileName;
const void* inMemoryBuffer;
unsigned inMemorySize;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgNewDeviceData
{
unsigned int version;
CmDeviceHandle dh;
CmUmdDeviceHandle udh;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgDeviceDestructionData
{
unsigned int version;
CmDeviceHandle dh;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgKernelBinaryData
{
unsigned int version;
CmUmdDeviceHandle udh;
CmUmdProgramHandle uph;
const char* kernelName;
void* genBinary;
unsigned int genBinarySize;
void* genDebugInfo;
unsigned int genDebugInfoSize;
const char* debugInfoFileName;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgKernelDebugData
{
unsigned int version;
GfxDeviceHandle hDevice;
GenRtProgramHandle hProgram;
const char* kernelName;
void* kernelBinBuffer;
unsigned int KernelBinSize;
const void* dbgVisaBuffer;
unsigned int dbgVisaSize;
const void* dbgGenIsaBuffer;
unsigned int dbgGenIsaSize;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgSourceCode
{
unsigned int version;
GfxDeviceHandle hDevice;
const char* sourceCode;
unsigned int sourceCodeSize;
unsigned int sourceNameMaxLen;
char* sourceName;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
enum GfxDbgOptionNames
{
DBG_OPTION_IS_OPTIMIZATION_DISABLED = 1
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgOption
{
unsigned int version;
GfxDbgOptionNames optionName;
unsigned int valueLen;
char* value;
};
// -------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------
struct GfxDbgTargetCaps
{
unsigned int version;
bool supportsLocalMemory;
};
#endif

View File

@@ -30,20 +30,15 @@ set(IGDRCL_SRCS_LIB_ULT
${IGDRCL_SOURCE_DIR}/unit_tests/helpers/test_files.h
${IGDRCL_SOURCE_DIR}/unit_tests/libult/create_tbx_sockets.cpp
${IGDRCL_SOURCE_DIR}/unit_tests/libult/ult_command_stream_receiver.h
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger.cpp
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger_library.cpp
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger_library.h
${IGDRCL_SOURCE_DIR}/unit_tests/program/evaluate_unhandled_token_ult.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_family.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_family.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.cpp
)
if(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
list(APPEND IGDRCL_SRCS_LIB_ULT
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger.cpp
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger_library.cpp
${IGDRCL_SOURCE_DIR}/unit_tests/libult/source_level_debugger_library.h
)
endif()
add_library (igdrcl_libult OBJECT
${IGDRCL_SRCS_LIB_ULT}
${IGDRCL_SRCS_ENABLE_TESTED_HW}

View File

@@ -11,6 +11,8 @@
#include <string>
#define IGFXDBG_CURRENT_VERSION 4
struct DebuggerLibraryInterceptor {
GfxDbgNewDeviceData newDeviceArgIn;
GfxDbgSourceCode sourceCodeArgIn;

View File

@@ -10,9 +10,6 @@ set(IGDRCL_SRCS_tests_source_level_debugger
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_csr_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_preamble_test.h
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_preamble_test.inl
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_tests.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_source_level_debugger})
if(SOURCE_LEVEL_DEBUGGER_HEADERS_DIR)
target_sources(igdrcl_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_tests.cpp)
endif()
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_source_level_debugger})