diff --git a/.gitignore b/.gitignore index a9a3cae8e9455..88165cf3073fd 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,6 @@ linker # ln -s $(pwd)/src/libraries/Common/src src/coreclr/src/System.Private.CoreLib/common src/coreclr/src/System.Private.CoreLib/shared src/coreclr/src/System.Private.CoreLib/common + +# The debug directory should not be ignored +!src/coreclr/src/debug diff --git a/src/coreclr/crosscomponents.cmake b/src/coreclr/crosscomponents.cmake index 30d53d585dff5..f8ea417471ca6 100644 --- a/src/coreclr/crosscomponents.cmake +++ b/src/coreclr/crosscomponents.cmake @@ -14,10 +14,6 @@ endif() if(NOT CLR_CMAKE_HOST_LINUX AND NOT FEATURE_CROSSBITNESS) list (APPEND CLR_CROSS_COMPONENTS_LIST mscordaccore + mscordbi ) - if (CLR_CMAKE_HOST_OS STREQUAL CLR_CMAKE_TARGET_OS) - list (APPEND CLR_CROSS_COMPONENTS_LIST - mscordbi - ) - endif (CLR_CMAKE_HOST_OS STREQUAL CLR_CMAKE_TARGET_OS) endif() diff --git a/src/coreclr/src/debug/debug-pal/CMakeLists.txt b/src/coreclr/src/debug/debug-pal/CMakeLists.txt index b06e46092caba..ac1e48fb5fb4d 100644 --- a/src/coreclr/src/debug/debug-pal/CMakeLists.txt +++ b/src/coreclr/src/debug/debug-pal/CMakeLists.txt @@ -8,11 +8,17 @@ if(CLR_CMAKE_HOST_WIN32) add_definitions(-DWIN32_LEAN_AND_MEAN) include_directories(../../inc) #needed for warning control - set(TWO_WAY_PIPE_SOURCES - win/diagnosticsipc.cpp - win/twowaypipe.cpp - win/processdescriptor.cpp - ) + if(CLR_CMAKE_TARGET_WIN32) + set(TWO_WAY_PIPE_SOURCES + win/diagnosticsipc.cpp + win/twowaypipe.cpp + win/processdescriptor.cpp + ) + else(CLR_CMAKE_TARGET_WIN32) + set(TWO_WAY_PIPE_SOURCES + dummy/twowaypipe.cpp + ) + endif(CLR_CMAKE_TARGET_WIN32) endif(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_UNIX) diff --git a/src/coreclr/src/debug/debug-pal/dummy/twowaypipe.cpp b/src/coreclr/src/debug/debug-pal/dummy/twowaypipe.cpp new file mode 100644 index 0000000000000..ed73fd75cf173 --- /dev/null +++ b/src/coreclr/src/debug/debug-pal/dummy/twowaypipe.cpp @@ -0,0 +1,76 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include +#include "twowaypipe.h" + +// This file contains a dummy implementation of the simple IPC mechanism - bidirectional named pipe. +// It is used for the cross OS DBI where IPC is not supported. + + +// Creates a server side of the pipe. +// Id is used to create pipes names and uniquely identify the pipe on the machine. +// true - success, false - failure (use GetLastError() for more details) +bool TwoWayPipe::CreateServer(const ProcessDescriptor& pd) +{ + return false; +} + + +// Connects to a previously opened server side of the pipe. +// Id is used to locate the pipe on the machine. +// true - success, false - failure (use GetLastError() for more details) +bool TwoWayPipe::Connect(const ProcessDescriptor& pd) +{ + return false; +} + +// Waits for incoming client connections, assumes GetState() == Created +// true - success, false - failure (use GetLastError() for more details) +bool TwoWayPipe::WaitForConnection() +{ + return false; +} + +// Reads data from pipe. Returns number of bytes read or a negative number in case of an error. +// use GetLastError() for more details +int TwoWayPipe::Read(void *buffer, DWORD bufferSize) +{ + return -1; +} + +// Writes data to pipe. Returns number of bytes written or a negative number in case of an error. +// use GetLastError() for more details +int TwoWayPipe::Write(const void *data, DWORD dataSize) +{ + return -1; +} + +// Disconnect server or client side of the pipe. +// true - success, false - failure (use GetLastError() for more details) +bool TwoWayPipe::Disconnect() +{ + return false; +} + +// Connects to a one sided pipe previously created by CreateOneWayPipe. +// In order to successfully connect id and inbound flag should be the same. +HANDLE TwoWayPipe::OpenOneWayPipe(DWORD id, bool inbound) +{ + return NULL; +} + + +// Creates a one way pipe, id and inboud flag are used for naming. +// Created pipe is supposed to be connected to by OpenOneWayPipe. +HANDLE TwoWayPipe::CreateOneWayPipe(DWORD id, bool inbound) +{ + return NULL; +} + +// Used by debugger side (RS) to cleanup the target (LS) named pipes +// and semaphores when the debugger detects the debuggee process exited. +void TwoWayPipe::CleanupTargetProcess() +{ +} diff --git a/src/coreclr/src/debug/di/cordb.cpp b/src/coreclr/src/debug/di/cordb.cpp index df6679040d196..280cda4ef5a8f 100644 --- a/src/coreclr/src/debug/di/cordb.cpp +++ b/src/coreclr/src/debug/di/cordb.cpp @@ -28,7 +28,7 @@ #endif //********** Globals. ********************************************************* -#ifndef TARGET_UNIX +#ifndef HOST_UNIX HINSTANCE g_hInst; // Instance handle to this piece of code. #endif diff --git a/src/coreclr/src/dlls/mscordbi/CMakeLists.txt b/src/coreclr/src/dlls/mscordbi/CMakeLists.txt index 3f4568fa75d62..6d189272c75ae 100644 --- a/src/coreclr/src/dlls/mscordbi/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscordbi/CMakeLists.txt @@ -19,7 +19,7 @@ if(CLR_CMAKE_HOST_LINUX) list(APPEND MSCORDBI_SOURCES ${PAL_REDEFINES_FILE}) endif(CLR_CMAKE_HOST_LINUX) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) add_definitions(-DFX_VER_INTERNALNAME_STR=mscordbi.dll) list(APPEND MSCORDBI_SOURCES @@ -35,11 +35,11 @@ if(CLR_CMAKE_TARGET_WIN32) preprocess_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def) list(APPEND MSCORDBI_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def) -else(CLR_CMAKE_TARGET_WIN32) +else(CLR_CMAKE_HOST_WIN32) set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordbi_unixexports.src) set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.exports) generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE}) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) # This option is necessary to ensure that the overloaded new/delete operators defined inside @@ -79,9 +79,13 @@ set(COREDBI_LIBRARIES ) if(CLR_CMAKE_HOST_WIN32) + if(CLR_CMAKE_TARGET_WIN32) + set(COREDBI_TARGET_WIN32_LIBRARIES mdwinmd_dbi) + endif(CLR_CMAKE_TARGET_WIN32) + list(APPEND COREDBI_LIBRARIES mdhotdata-staticcrt - mdwinmd_dbi + ${COREDBI_TARGET_WIN32_LIBRARIES} kernel32.lib advapi32.lib ole32.lib diff --git a/src/coreclr/src/md/hotdata/CMakeLists.txt b/src/coreclr/src/md/hotdata/CMakeLists.txt index fdcf90aabc2ac..c6168d2a4b0c2 100644 --- a/src/coreclr/src/md/hotdata/CMakeLists.txt +++ b/src/coreclr/src/md/hotdata/CMakeLists.txt @@ -40,7 +40,7 @@ add_library_clr(mdhotdata_crossgen ${MDHOTDATA_SOURCES}) set_target_properties(mdhotdata_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) target_precompile_header(TARGET mdhotdata_crossgen HEADER external.h) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES}) target_precompile_header(TARGET mdhotdata-staticcrt HEADER external.h) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32)