Permalink
Browse files

Move the windows unwinder code out of the debug folder.

It is a preparation for using the DAC unwinder code  as an unwinder
for the jitted code on Linux, because the jitter generates windows
style unwind info.
The unwinder is build as a static library and linked to mscordac.

[tfs-changeset: 1409640]
  • Loading branch information...
janvorli committed Feb 4, 2015
1 parent 58ef03f commit 6c2c7994f1412e8aa504800c7164de875c350fc1
Showing with 223 additions and 8 deletions.
  1. +1 −0 src/CMakeLists.txt
  2. +0 −2 src/debug/daccess/CMakeLists.txt
  3. +0 −6 src/debug/daccess/daccess.targets
  4. +1 −0 src/dirs.proj
  5. +1 −0 src/dlls/mscordac/CMakeLists.txt
  6. +3 −0 src/dlls/mscordac/mscordac.targets
  7. +1 −0 src/unwinder/.gitmirror
  8. +22 −0 src/unwinder/CMakeLists.txt
  9. +1 −0 src/unwinder/amd64/.gitmirror
  10. 0 src/{debug/daccess → unwinder}/amd64/dbs_stack_x64.cpp
  11. 0 src/{debug/daccess → unwinder}/amd64/unwinder_amd64.cpp
  12. 0 src/{debug/daccess → unwinder}/amd64/unwinder_amd64.h
  13. +1 −0 src/unwinder/arm/.gitmirror
  14. 0 src/{debug/daccess → unwinder}/arm/unwinder_arm.cpp
  15. 0 src/{debug/daccess → unwinder}/arm/unwinder_arm.h
  16. +1 −0 src/unwinder/arm64/.gitmirror
  17. 0 src/{debug/daccess → unwinder}/arm64/unwinder_arm64.cpp
  18. 0 src/{debug/daccess → unwinder}/arm64/unwinder_arm64.h
  19. +1 −0 src/unwinder/dac/.gitmirror
  20. +10 −0 src/unwinder/dac/CMakeLists.txt
  21. +18 −0 src/unwinder/dac/dirs.proj
  22. +1 −0 src/unwinder/dac/hostlocal/.gitmirror
  23. +13 −0 src/unwinder/dac/hostlocal/unwinder_dac.nativeproj
  24. +1 −0 src/unwinder/dac/hostwinamd64/.gitmirror
  25. +5 −0 src/unwinder/dac/hostwinamd64/CMakeLists.txt
  26. +15 −0 src/unwinder/dac/hostwinamd64/unwinder_dac.nativeproj
  27. +1 −0 src/unwinder/dac/hostwinx86/.gitmirror
  28. +15 −0 src/unwinder/dac/hostwinx86/unwinder_dac.nativeproj
  29. +19 −0 src/unwinder/dirs.proj
  30. +13 −0 src/unwinder/stdafx.cpp
  31. +19 −0 src/unwinder/stdafx.h
  32. 0 src/{debug/daccess → unwinder}/unwinder.cpp
  33. 0 src/{debug/daccess → unwinder}/unwinder.h
  34. +60 −0 src/unwinder/unwinder.targets
@@ -30,6 +30,7 @@ add_subdirectory(strongname)
add_subdirectory(binder)
add_subdirectory(classlibnative)
add_subdirectory(dlls)
add_subdirectory(unwinder)

if(WIN32)
add_subdirectory(ipcman)
@@ -38,9 +38,7 @@ if(IS_64BIT_BUILD EQUAL 1)

set(DACCESS_SOURCES
${DACCESS_SOURCES}
unwinder.cpp
amd64/primitives.cpp
amd64/unwinder_amd64.cpp
)
else(IS_64BIT_BUILD EQUAL 1)
set(DACCESS_SOURCES
@@ -58,15 +58,9 @@
</ItemGroup>
<ItemGroup>
<CppCompile Condition="'$(TargetArch)' == 'i386'" Include="$(DaccessSrcDirectory)\i386\primitives.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'amd64'" Include="$(DaccessSrcDirectory)\unwinder.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'amd64'" Include="$(DaccessSrcDirectory)\amd64\unwinder_amd64.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'amd64'" Include="$(DaccessSrcDirectory)\amd64\primitives.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm'" Include="$(DaccessSrcDirectory)\arm\primitives.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm'" Include="$(DaccessSrcDirectory)\arm\unwinder_arm.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm'" Include="$(DaccessSrcDirectory)\unwinder.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm64'" Include="$(DaccessSrcDirectory)\arm64\primitives.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm64'" Include="$(DaccessSrcDirectory)\arm64\unwinder_arm64.cpp" />
<CppCompile Condition="'$(TargetArch)' == 'arm64'" Include="$(DaccessSrcDirectory)\unwinder.cpp" />
</ItemGroup>
<!--Import the targets-->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.targets" />
@@ -40,6 +40,7 @@
<ProjectFile Include="gcinfo\dirs.proj" />
<ProjectFile Include="delayimp\delayimp.nativeproj" Condition="'$(BuildProjectName)' != 'CoreSys'"/>
<ProjectFile Include="dlls\dirs.proj" />
<ProjectFile Include="unwinder\dirs.proj" Condition="'$(TargetArch)' != 'i386'" />

<!-- In FXMain we build RyuJIT only for amd64 and arm64 -->
<ProjectFile Include="jit32\dirs.proj" Condition="'$(BuildArchitecture)' != 'amd64' and '$(BuildArchitecture)' != 'arm64'"/>
@@ -37,6 +37,7 @@ set(COREDAC_LIBRARIES
mdruntimerw_dac
strongname_dac
utilcode_dac
unwinder_dac
)

if(WIN32)
@@ -77,6 +77,9 @@
<TargetLib Include="$(ClrLibPath)\strongname_dac$(XPlatHostLibSuffix).lib">
<ProjectReference>$(ClrSrcDirectory)StrongName\api\dac\$(XPlatHostLibBuildDir)\strongname_dac.nativeproj</ProjectReference>
</TargetLib>
<TargetLib Condition="'$(TargetArch)' != 'i386'" Include="$(ClrLibPath)\unwinder_dac$(XPlatHostLibSuffix).lib">
<ProjectReference>$(ClrSrcDirectory)unwinder\dac\$(XPlatHostLibBuildDir)\unwinder_dac.nativeproj</ProjectReference>
</TargetLib>
<TargetLib Include="$(ClrLibPath)\dbgutil$(XPlatHostLibSuffix).lib">
<ProjectReference>$(ClrSrcDirectory)debug\dbgutil\$(XPlatHostLibBuildDir)\dbgutil.nativeproj</ProjectReference>
</TargetLib>
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1,22 @@
include_directories(BEFORE ${VM_DIR})
include_directories(BEFORE ${VM_DIR}/${ARCH_SOURCES_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(BEFORE ${CLR_DIR}/src/unwinder)
include_directories(${CLR_DIR}/src/debug/ee)
include_directories(${CLR_DIR}/src/gc)
include_directories(${CLR_DIR}/src/gcdump)
include_directories(${CLR_DIR}/src/debug/daccess)

if(IS_64BIT_BUILD EQUAL 1)
include_directories(amd64)

set(UNWINDER_SOURCES
unwinder.cpp
amd64/unwinder_amd64.cpp
)

convert_to_absolute_path(UNWINDER_SOURCES ${UNWINDER_SOURCES})

add_subdirectory(dac)
endif(IS_64BIT_BUILD EQUAL 1)

@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1,10 @@
include(${CLR_DIR}/dac.cmake)

add_definitions(-DFEATURE_NO_HOST)
add_definitions(-D_TARGET_AMD64_=1)
add_definitions(-DDBG_TARGET_64BIT=1)
add_definitions(-DDBG_TARGET_AMD64=1)
add_definitions(-DDBG_TARGET_WIN64=1)
add_definitions(-D_WIN64=1)

add_library(unwinder_dac ${UNWINDER_SOURCES})
@@ -0,0 +1,18 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Import the settings-->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />

<PropertyGroup>
<BuildInPhase1>true</BuildInPhase1>
<BuildInPhaseDefault>false</BuildInPhaseDefault>
<BuildCoreBinaries>true</BuildCoreBinaries>
<BuildSysBinaries>true</BuildSysBinaries>
</PropertyGroup>

<!--The following projects will build during PHASE 1-->
<ItemGroup Condition="'$(BuildExePhase)' == '1'">
<ProjectFile Include="hostlocal\unwinder_dac.nativeproj" />
</ItemGroup>

<Import Project="$(_NTDRIVE)$(_NTROOT)\tools\Microsoft.DevDiv.Traversal.targets" />
</Project>
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<BuildCoreBinaries>true</BuildCoreBinaries>
<BuildSysBinaries>true</BuildSysBinaries>
<OutputName>unwinder_dac</OutputName>
</PropertyGroup>

<!-- compile items -->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\src\unwinder\unwinder.targets" />

</Project>
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1,5 @@
remove_definitions(-DPROFILING_SUPPORTED)
add_definitions(-DPROFILING_SUPPORTED_DATA)
add_definitions(-DDACCESS_COMPILE)

add_library(unwinder_dac_amd64 ${UNWINDER_SOURCES})
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- xplat Windows host, local target DAC build -->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\xplat\SetTargetLocal.props" />
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\xplat\SetHostWinAMD64.props" />
<PropertyGroup>
<BuildSysBinaries>true</BuildSysBinaries>
<OutputName>unwinder_dac_amd64</OutputName>
</PropertyGroup>

<!-- compile items -->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\src\unwinder\unwinder.targets" />

</Project>
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- xplat win32 host, local target DAC build -->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\xplat\SetTargetLocal.props" />
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\xplat\SetHostWinx86.props" />
<PropertyGroup>
<BuildSysBinaries>true</BuildSysBinaries>
<OutputName>unwinder_dac_x86</OutputName>
</PropertyGroup>

<!-- compile items -->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\src\unwinder\unwinder.targets" />

</Project>
@@ -0,0 +1,19 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Import the settings-->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />

<PropertyGroup>
<BuildInPhase1>true</BuildInPhase1>
<BuildInPhaseDefault>false</BuildInPhaseDefault>
<BuildCoreBinaries>true</BuildCoreBinaries>
<BuildSysBinaries>true</BuildSysBinaries>
</PropertyGroup>

<!--The following projects will build during PHASE 1-->
<ItemGroup Condition="'$(BuildExePhase)' == '1'">
<ProjectFile Include="dac\dirs.proj" />
</ItemGroup>

<!--Import the targets-->
<Import Project="$(_NTDRIVE)$(_NTROOT)\tools\Microsoft.DevDiv.Traversal.targets" />
</Project>
@@ -0,0 +1,13 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
//*****************************************************************************
// File: stdafx.cpp
//

//
// Host for precompiled headers.
//
//*****************************************************************************
#include "stdafx.h" // Precompiled header key.
@@ -0,0 +1,19 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
//*****************************************************************************
// File: stdafx.h
//

// Prevent the inclusion of Random.h from disabling rand(). rand() is used by some other headers we include
// and there's no reason why DAC should be forbidden from using it.
#define DO_NOT_DISABLE_RAND

#define USE_COM_CONTEXT_DEF

#include <common.h>
#include <debugger.h>
#include <methoditer.h>
#include <dacprivate.h>
#include <dacimpl.h>
File renamed without changes.
@@ -0,0 +1,60 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--Import the settings-->
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" />
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\dac.props" />
<Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\src\debug\SetDebugTargetLocal.props" />
<!--Leaf project Properties-->
<PropertyGroup>
<UseStl Condition="'$(BuildForCoreSystem)' != 'true'">true</UseStl>

<UserIncludes>
$(UserIncludes);
$(ClrSrcDirectory)\unwinder;
$(ClrSrcDirectory)\debug\daccess;
$(ClrSrcDirectory)\vm;
$(ClrSrcDirectory)\vm\$(TargetCpu);
$(ClrSrcDirectory)\debug\inc;
$(ClrSrcDirectory)\debug\inc\$(TargetCpu);
$(ClrSrcDirectory)\debug\inc\dump;
$(ClrSrcDirectory)\debug\ee;
$(ClrSrcDirectory)\inc;
$(VCToolsIncPath);
</UserIncludes>

<CDefines>$(CDefines);UNICODE;_UNICODE;$(USER_SPECIFIC_C_DEFINES);FEATURE_NO_HOST</CDefines>

<OutputName Condition="'$(OutputName)' == ''">unwinder_dac</OutputName>
<OutputPath>$(ClrLibDest)</OutputPath>
<TargetType>LIBRARY</TargetType>
<PCHHeader>stdafx.h</PCHHeader>
<EnableCxxPCHHeaders>true</EnableCxxPCHHeaders>
<PCHCompile>$(ClrSrcDirectory)\unwinder\stdafx.cpp</PCHCompile>

<UnwinderSourcesDir>$(ClrSrcDirectory)\unwinder</UnwinderSourcesDir>
<Amd64SourcesDir>$(ClrSrcDirectory)\unwinder\amd64</Amd64SourcesDir>
<ArmSourcesDir>$(ClrSrcDirectory)\unwinder\arm</ArmSourcesDir>
<Arm64SourcesDir>$(ClrSrcDirectory)\unwinder\arm64</Arm64SourcesDir>
</PropertyGroup>

<ItemGroup>
<CppCompile Include="$(UnwinderSourcesDir)\unwinder.cpp" />
</ItemGroup>

<!-- AMD64_SOURCES -->
<ItemGroup Condition="'$(TargetArch)' == 'amd64'">
<CppCompile Include="$(Amd64SourcesDir)\unwinder_amd64.cpp" />
</ItemGroup>
<!-- ARM_SOURCES -->
<ItemGroup Condition="'$(TargetArch)' == 'arm'">
<CppCompile Include="$(ArmSourcesDir)\unwinder_arm.cpp" />
</ItemGroup>
<!-- ARM64_SOURCES -->
<ItemGroup Condition="'$(TargetArch)' == 'arm64'">
<CppCompile Include="$(Arm64SourcesDir)\unwinder_arm64.cpp" />
</ItemGroup>

<Import Project="$(Clrbase)\clr.targets" />

</Project>

0 comments on commit 6c2c799

Please sign in to comment.