Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
#35 able to get all of the Methods of a Document
Browse files Browse the repository at this point in the history
started removing System.Diagnostics.SymbolStore interfaces
way too many NotImplementedExceptions NIEs in it
  • Loading branch information
Cameron Taggart committed Nov 15, 2014
1 parent 0c1421c commit b575272
Show file tree
Hide file tree
Showing 21 changed files with 438 additions and 355 deletions.
106 changes: 53 additions & 53 deletions Build/Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,59 +42,6 @@
<OtherFlags>
</OtherFlags>
</PropertyGroup>
<ItemGroup>
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Proj.fs" />
<Compile Include="Task.fs" />
<Compile Include="SourceCheck.fs" />
<Compile Include="SourceLink.fs" />
<None Include="App.config" />
<None Include="Build.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SourceLink.Build.targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="paket.references" />
<Compile Include="AssemblyInfo.fs" Condition="Exists('AssemblyInfo.fs')" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Git\Git.fsproj">
<Name>Git</Name>
<Project>{726a13b9-f319-40fa-aef6-fe629cfdaf6a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries"
if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86"
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"
</PostBuildEvent>
</PropertyGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework'">
<Choose>
Expand Down Expand Up @@ -172,4 +119,57 @@ xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Proj.fs" />
<Compile Include="Task.fs" />
<Compile Include="SourceCheck.fs" />
<Compile Include="SourceLink.fs" />
<None Include="App.config" />
<None Include="Build.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SourceLink.Build.targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="paket.references" />
<Compile Include="AssemblyInfo.fs" Condition="Exists('AssemblyInfo.fs')" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Git\Git.fsproj">
<Name>Git</Name>
<Project>{726a13b9-f319-40fa-aef6-fe629cfdaf6a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries"
if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86"
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"
</PostBuildEvent>
</PropertyGroup>
</Project>
111 changes: 58 additions & 53 deletions ConsoleTest/ConsoleTest.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,59 +39,6 @@
</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Checksums.fs" />
<Compile Include="RootAndInfo.fs" />
<Compile Include="Program.fs" />
<None Include="Git.fsx" />
<None Include="BuildInfo.fsx" />
<None Include="Dia.fsx" />
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Git\Git.fsproj">
<Name>Git</Name>
<Project>{726a13b9-f319-40fa-aef6-fe629cfdaf6a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\Pe\Pe.fsproj">
<Name>Pe</Name>
<Project>{12331d73-8eb9-4a60-9079-00d26b71a04b}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries"
if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86"
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"
</PostBuildEvent>
</PropertyGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework'">
<Choose>
Expand Down Expand Up @@ -169,4 +116,62 @@ xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="printfn.fs" />
<Compile Include="Checksums.fs" />
<Compile Include="RootAndInfo.fs" />
<Compile Include="Program.fs" />
<None Include="Git.fsx" />
<None Include="BuildInfo.fsx" />
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Git\Git.fsproj">
<Name>Git</Name>
<Project>{726a13b9-f319-40fa-aef6-fe629cfdaf6a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\Pe\Pe.fsproj">
<Name>Pe</Name>
<Project>{12331d73-8eb9-4a60-9079-00d26b71a04b}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\SymbolStore\SymbolStore.csproj">
<Name>SymbolStore</Name>
<Project>{f764ced4-2f3c-49ec-ba9f-99105707b607}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries"
if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86"
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"
</PostBuildEvent>
</PropertyGroup>
</Project>
47 changes: 0 additions & 47 deletions ConsoleTest/Dia.fsx

This file was deleted.

30 changes: 29 additions & 1 deletion ConsoleTest/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,44 @@ open System.IO
open SourceLink
//open SourceLink.PdbModify
//open SourceLink.SrcSrv
open SourceLink.SymbolStore

let getNugetExeShas() =
let f = @"C:\Projects\SourceLink\.nuget\NuGet.exe"
printfn "calculated: %s" (GitRepo.ComputeChecksum f)
use r = new GitRepo(@"C:\Projects\SourceLink")
printfn "in repo: %s" (r.Checksum f)

// print methods and their files and line numbers
let printMethodsFileLines() =
let dll = @"..\..\..\packages\SourceLink.SymbolStore\lib\net45\SourceLink.SymbolStore.dll"
let pdb = Path.ChangeExtension(dll, ".pdb")
let sc = SymbolCache @"C:\tmp\cache"
use s = File.OpenRead pdb
use r = sc.ReadPdb(s, pdb)

for d in r.Documents do
for m in d.GetMethods r.ISymUnmanagedReader2 do
let token = m.Token.GetToken()
let fn = m.GetFileNameFromOffset 0

printfn "%d method in %s" token fn
printfn " %d sequence points" m.SequencePointCount
for p in m.SequencePoints do
printfn "%d, %d" p.Line p.Column
()


// let a = Assembly.LoadFrom dll
// for dt in a.DefinedTypes do
// printfn "\n%s" dt.FullName
// for m in dt.GetMembers() do
// printfn " %d %s" m.MetadataToken m.Name

[<EntryPoint>]
let main argv =
getNugetExeShas()
// getNugetExeShas()
// let mdd = Cor.CorMetaDataDispenser() :> Cor.IMetaDataDispenser
// printfn "mdd: %A" mdd
printMethodsFileLines()
0
4 changes: 4 additions & 0 deletions ConsoleTest/printfn.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[<AutoOpen>]
module Printfn

let printfn format = Printf.ksprintf (fun message -> System.Diagnostics.Debug.WriteLine message) format
40 changes: 20 additions & 20 deletions Git/Git.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,6 @@
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="GitRepo.fs" />
<None Include="paket.references" />
<None Include="Git.nuspec" />
<Compile Include="AssemblyInfo.fs" Condition="Exists('AssemblyInfo.fs')" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework'">
<Choose>
Expand Down Expand Up @@ -135,4 +115,24 @@
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="GitRepo.fs" />
<None Include="paket.references" />
<None Include="Git.nuspec" />
<Compile Include="AssemblyInfo.fs" Condition="Exists('AssemblyInfo.fs')" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<ProjectReference Include="..\SourceLink\SourceLink.fsproj">
<Name>SourceLink</Name>
<Project>{aaf1b8d7-791e-40f1-a278-9a16d9667866}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
</Project>
Loading

0 comments on commit b575272

Please sign in to comment.