Skip to content

Commit 5694452

Browse files
committed
Move MS.NET debugger into Main
So we can easily debug when developing MD on Windows
0 parents  commit 5694452

File tree

93 files changed

+24039
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+24039
-0
lines changed

CorApi/CorApi.csproj

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.50727</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{9FBCC262-10DC-4E84-A5C4-17230BBF8862}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>CorApi</RootNamespace>
11+
<AssemblyName>CorApi</AssemblyName>
12+
<RunPostBuildEvent>Always</RunPostBuildEvent>
13+
<SccProjectName>
14+
</SccProjectName>
15+
<SccLocalPath>
16+
</SccLocalPath>
17+
<SccAuxPath>
18+
</SccAuxPath>
19+
<SccProvider>
20+
</SccProvider>
21+
<FileUpgradeFlags>
22+
</FileUpgradeFlags>
23+
<OldToolsVersion>3.5</OldToolsVersion>
24+
<UpgradeBackupLocation>
25+
</UpgradeBackupLocation>
26+
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
29+
<DebugSymbols>true</DebugSymbols>
30+
<DebugType>full</DebugType>
31+
<Optimize>false</Optimize>
32+
<OutputPath>bin\Debug\</OutputPath>
33+
<DefineConstants>DEBUG;TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
37+
<PlatformTarget>AnyCPU</PlatformTarget>
38+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
39+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
40+
</PropertyGroup>
41+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
42+
<DebugType>pdbonly</DebugType>
43+
<Optimize>true</Optimize>
44+
<OutputPath>bin\Release\</OutputPath>
45+
<DefineConstants>TRACE</DefineConstants>
46+
<ErrorReport>prompt</ErrorReport>
47+
<WarningLevel>4</WarningLevel>
48+
<PlatformTarget>AnyCPU</PlatformTarget>
49+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
50+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
51+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
52+
</PropertyGroup>
53+
<ItemGroup>
54+
<Reference Include="System" />
55+
<Reference Include="System.Data" />
56+
<Reference Include="System.Xml" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<Compile Include="IMetadataImport.cs" />
60+
<Compile Include="ICorDebugWrappers.cs" />
61+
<Compile Include="ICorPublishWrappers.cs" />
62+
<Compile Include="RawAssemblyAttributes.cs" />
63+
<Compile Include="WindowsImports.cs" />
64+
</ItemGroup>
65+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
66+
</Project>

CorApi/ICorDebugWrappers.cs

+1,906
Large diffs are not rendered by default.

CorApi/ICorPublishWrappers.cs

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
//---------------------------------------------------------------------
2+
// This file is part of the CLR Managed Debugger (mdbg) Sample.
3+
//
4+
// Copyright (C) Microsoft Corporation. All rights reserved.
5+
//
6+
// Imports ICorPublish interface from CorPublish.idl into managed code
7+
//---------------------------------------------------------------------
8+
9+
using System;
10+
using System.Text;
11+
using System.Runtime.CompilerServices;
12+
using System.Runtime.InteropServices;
13+
14+
using IStream=System.Runtime.InteropServices.ComTypes.IStream;
15+
using Microsoft.Win32.SafeHandles;
16+
17+
namespace Microsoft.Samples.Debugging.CorPublish.NativeApi
18+
{
19+
public enum __MIDL___MIDL_itf_corpub_0000_0001
20+
{
21+
// Fields
22+
COR_PUB_MANAGEDONLY = 1
23+
}
24+
25+
public enum COR_PUB_ENUMPROCESS
26+
{
27+
// Fields
28+
COR_PUB_MANAGEDONLY = 1
29+
}
30+
31+
[ComImport, Guid("9613A0E7-5A68-11D3-8F84-00A0C9B4D50C"), CoClass(typeof(CorpubPublishClass))]
32+
public interface CorpubPublish : ICorPublish
33+
{
34+
}
35+
36+
[ComImport, TypeLibType(2), Guid("047a9a40-657e-11d3-8d5b-00104b35e7ef"), ClassInterface(ClassInterfaceType.None)]
37+
public class CorpubPublishClass : ICorPublish, CorpubPublish
38+
{
39+
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
40+
public virtual extern void EnumProcesses(
41+
[In, ComAliasName("CorpubProcessLib.COR_PUB_ENUMPROCESS")] COR_PUB_ENUMPROCESS Type,
42+
[Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcessEnum ppIEnum);
43+
44+
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
45+
public virtual extern void GetProcess([In] uint pid, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess ppProcess);
46+
}
47+
48+
[ComImport, Guid("9613A0E7-5A68-11D3-8F84-00A0C9B4D50C"), InterfaceType(1)]
49+
public interface ICorPublish
50+
{
51+
52+
void EnumProcesses([In, ComAliasName("CorpubProcessLib.COR_PUB_ENUMPROCESS")] COR_PUB_ENUMPROCESS Type, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcessEnum ppIEnum);
53+
54+
void GetProcess([In] uint pid, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess ppProcess);
55+
}
56+
57+
[ComImport, Guid("D6315C8F-5A6A-11D3-8F84-00A0C9B4D50C"), InterfaceType(1)]
58+
public interface ICorPublishAppDomain
59+
{
60+
61+
void GetID([Out] out uint puId);
62+
63+
void GetName([In] uint cchName, [Out] out uint pcchName, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName);
64+
}
65+
66+
[ComImport, InterfaceType(1), Guid("9F0C98F5-5A6A-11D3-8F84-00A0C9B4D50C")]
67+
public interface ICorPublishAppDomainEnum : ICorPublishEnum
68+
{
69+
70+
new void Skip([In] uint celt);
71+
72+
new void Reset();
73+
74+
new void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum);
75+
76+
new void GetCount([Out] out uint pcelt);
77+
[PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
78+
int Next([In] uint celt, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishAppDomain objects, [Out] out uint pceltFetched);
79+
}
80+
81+
[ComImport, InterfaceType(1), Guid("C0B22967-5A69-11D3-8F84-00A0C9B4D50C")]
82+
public interface ICorPublishEnum
83+
{
84+
85+
void Skip([In] uint celt);
86+
87+
void Reset();
88+
89+
void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum);
90+
91+
void GetCount([Out] out uint pcelt);
92+
}
93+
94+
[ComImport, InterfaceType(1), Guid("18D87AF1-5A6A-11D3-8F84-00A0C9B4D50C")]
95+
public interface ICorPublishProcess
96+
{
97+
98+
void IsManaged([Out] out int pbManaged);
99+
100+
void EnumAppDomains([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishAppDomainEnum ppEnum);
101+
102+
void GetProcessID([Out] out uint pid);
103+
104+
void GetDisplayName([In] uint cchName, [Out] out uint pcchName, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName);
105+
}
106+
107+
[ComImport, InterfaceType(1), Guid("A37FBD41-5A69-11D3-8F84-00A0C9B4D50C")]
108+
public interface ICorPublishProcessEnum : ICorPublishEnum
109+
{
110+
111+
new void Skip([In] uint celt);
112+
113+
new void Reset();
114+
115+
new void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum);
116+
117+
new void GetCount([Out] out uint pcelt);
118+
[PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
119+
int Next([In] uint celt, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess objects, [Out] out uint pceltFetched);
120+
}
121+
}
122+
123+

0 commit comments

Comments
 (0)