Imported Upstream version 5.8.0.88
Former-commit-id: 4b7216ffda08448e562271ce733688e761120fc5
This commit is contained in:
parent
7d05485754
commit
6123a772ed
@ -1 +1 @@
|
|||||||
3fb2fb8eee096ec9f26b7a4dae0ff3e1d0fb7eb1
|
37c1b000c4419715dad5a8f78a060364b72479dd
|
@ -1 +1 @@
|
|||||||
3aa404de51236fe4a603243f724c4b33a6d206c1
|
0fcbd9917a47e8f359dbdcbd676abae3b61dc4e6
|
@ -7,7 +7,7 @@
|
|||||||
[assembly:System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute.DebuggingModes)(2))]
|
[assembly:System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute.DebuggingModes)(2))]
|
||||||
[assembly:System.Reflection.AssemblyCopyrightAttribute("Copyright © 2008 - 2015 Jb Evain")]
|
[assembly:System.Reflection.AssemblyCopyrightAttribute("Copyright © 2008 - 2015 Jb Evain")]
|
||||||
[assembly:System.Reflection.AssemblyFileVersionAttribute("0.10.0.0")]
|
[assembly:System.Reflection.AssemblyFileVersionAttribute("0.10.0.0")]
|
||||||
[assembly:System.Reflection.AssemblyInformationalVersionAttribute("0.10.0.0-beta6")]
|
[assembly:System.Reflection.AssemblyInformationalVersionAttribute("0.10.0.0-beta7")]
|
||||||
[assembly:System.Reflection.AssemblyProductAttribute("Mono.Cecil")]
|
[assembly:System.Reflection.AssemblyProductAttribute("Mono.Cecil")]
|
||||||
[assembly:System.Reflection.AssemblyTitleAttribute("Mono.Cecil.Mdb")]
|
[assembly:System.Reflection.AssemblyTitleAttribute("Mono.Cecil.Mdb")]
|
||||||
[assembly:System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8)]
|
[assembly:System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8)]
|
||||||
|
@ -1 +1 @@
|
|||||||
9f405648ac44af0776db1fccb6ed79229217457a
|
dfcf34172908a18aaf781b2b50e901e96b820136
|
217
external/cecil/Mono.Cecil.Cil/CodeReader.cs
vendored
217
external/cecil/Mono.Cecil.Cil/CodeReader.cs
vendored
@ -45,7 +45,7 @@ namespace Mono.Cecil.Cil {
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveBackTo (int position)
|
public void MoveBackTo (int position)
|
||||||
{
|
{
|
||||||
this.reader.context = null;
|
this.reader.context = null;
|
||||||
this.Position = position;
|
this.Position = position;
|
||||||
@ -62,6 +62,30 @@ namespace Mono.Cecil.Cil {
|
|||||||
return this.body;
|
return this.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ReadCodeSize (MethodDefinition method)
|
||||||
|
{
|
||||||
|
var position = MoveTo (method);
|
||||||
|
|
||||||
|
var code_size = ReadCodeSize ();
|
||||||
|
|
||||||
|
MoveBackTo (position);
|
||||||
|
return code_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReadCodeSize ()
|
||||||
|
{
|
||||||
|
var flags = ReadByte ();
|
||||||
|
switch (flags & 0x3) {
|
||||||
|
case 0x2: // tiny
|
||||||
|
return flags >> 2;
|
||||||
|
case 0x3: // fat
|
||||||
|
Advance (-1 + 2 + 2); // go back, 2 bytes flags, 2 bytes stack size
|
||||||
|
return (int) ReadUInt32 ();
|
||||||
|
default:
|
||||||
|
throw new InvalidOperationException ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReadMethodBody ()
|
void ReadMethodBody ()
|
||||||
{
|
{
|
||||||
var flags = ReadByte ();
|
var flags = ReadByte ();
|
||||||
@ -88,99 +112,6 @@ namespace Mono.Cecil.Cil {
|
|||||||
ReadDebugInfo ();
|
ReadDebugInfo ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadDebugInfo ()
|
|
||||||
{
|
|
||||||
if (method.debug_info.sequence_points != null)
|
|
||||||
ReadSequencePoints ();
|
|
||||||
|
|
||||||
if (method.debug_info.scope != null)
|
|
||||||
ReadScope (method.debug_info.scope);
|
|
||||||
|
|
||||||
if (method.custom_infos != null)
|
|
||||||
ReadCustomDebugInformations (method);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadCustomDebugInformations (MethodDefinition method)
|
|
||||||
{
|
|
||||||
var custom_infos = method.custom_infos;
|
|
||||||
|
|
||||||
for (int i = 0; i < custom_infos.Count; i++) {
|
|
||||||
var state_machine_scope = custom_infos [i] as StateMachineScopeDebugInformation;
|
|
||||||
if (state_machine_scope != null)
|
|
||||||
ReadStateMachineScope (state_machine_scope);
|
|
||||||
|
|
||||||
var async_method = custom_infos [i] as AsyncMethodBodyDebugInformation;
|
|
||||||
if (async_method != null)
|
|
||||||
ReadAsyncMethodBody (async_method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadAsyncMethodBody (AsyncMethodBodyDebugInformation async_method)
|
|
||||||
{
|
|
||||||
if (async_method.catch_handler.Offset > -1)
|
|
||||||
async_method.catch_handler = new InstructionOffset (GetInstruction (async_method.catch_handler.Offset));
|
|
||||||
|
|
||||||
if (!async_method.yields.IsNullOrEmpty ())
|
|
||||||
for (int i = 0; i < async_method.yields.Count; i++)
|
|
||||||
async_method.yields [i] = new InstructionOffset (GetInstruction (async_method.yields [i].Offset));
|
|
||||||
|
|
||||||
if (!async_method.resumes.IsNullOrEmpty ())
|
|
||||||
for (int i = 0; i < async_method.resumes.Count; i++)
|
|
||||||
async_method.resumes [i] = new InstructionOffset (GetInstruction (async_method.resumes [i].Offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadStateMachineScope (StateMachineScopeDebugInformation state_machine_scope)
|
|
||||||
{
|
|
||||||
state_machine_scope.start = new InstructionOffset (GetInstruction (state_machine_scope.start.Offset));
|
|
||||||
|
|
||||||
var end_instruction = GetInstruction (state_machine_scope.end.Offset);
|
|
||||||
state_machine_scope.end = end_instruction == null
|
|
||||||
? new InstructionOffset ()
|
|
||||||
: new InstructionOffset (end_instruction);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadSequencePoints ()
|
|
||||||
{
|
|
||||||
var symbol = method.debug_info;
|
|
||||||
|
|
||||||
for (int i = 0; i < symbol.sequence_points.Count; i++) {
|
|
||||||
var sequence_point = symbol.sequence_points [i];
|
|
||||||
var instruction = GetInstruction (sequence_point.Offset);
|
|
||||||
if (instruction != null)
|
|
||||||
sequence_point.offset = new InstructionOffset (instruction);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadScopes (Collection<ScopeDebugInformation> scopes)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < scopes.Count; i++)
|
|
||||||
ReadScope (scopes [i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadScope (ScopeDebugInformation scope)
|
|
||||||
{
|
|
||||||
var start_instruction = GetInstruction (scope.Start.Offset);
|
|
||||||
if (start_instruction != null)
|
|
||||||
scope.Start = new InstructionOffset (start_instruction);
|
|
||||||
|
|
||||||
var end_instruction = GetInstruction (scope.End.Offset);
|
|
||||||
scope.End = end_instruction != null
|
|
||||||
? new InstructionOffset (end_instruction)
|
|
||||||
: new InstructionOffset ();
|
|
||||||
|
|
||||||
if (!scope.variables.IsNullOrEmpty ()) {
|
|
||||||
for (int i = 0; i < scope.variables.Count; i++) {
|
|
||||||
var variable_info = scope.variables [i];
|
|
||||||
var variable = GetVariable (variable_info.Index);
|
|
||||||
if (variable != null)
|
|
||||||
variable_info.index = new VariableIndex (variable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!scope.scopes.IsNullOrEmpty ())
|
|
||||||
ReadScopes (scope.scopes);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadFatMethod ()
|
void ReadFatMethod ()
|
||||||
{
|
{
|
||||||
var flags = ReadUInt16 ();
|
var flags = ReadUInt16 ();
|
||||||
@ -442,6 +373,104 @@ namespace Mono.Cecil.Cil {
|
|||||||
return new MetadataToken (ReadUInt32 ());
|
return new MetadataToken (ReadUInt32 ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReadDebugInfo ()
|
||||||
|
{
|
||||||
|
if (method.debug_info.sequence_points != null)
|
||||||
|
ReadSequencePoints ();
|
||||||
|
|
||||||
|
if (method.debug_info.scope != null)
|
||||||
|
ReadScope (method.debug_info.scope);
|
||||||
|
|
||||||
|
if (method.custom_infos != null)
|
||||||
|
ReadCustomDebugInformations (method);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadCustomDebugInformations (MethodDefinition method)
|
||||||
|
{
|
||||||
|
var custom_infos = method.custom_infos;
|
||||||
|
|
||||||
|
for (int i = 0; i < custom_infos.Count; i++) {
|
||||||
|
var state_machine_scope = custom_infos [i] as StateMachineScopeDebugInformation;
|
||||||
|
if (state_machine_scope != null)
|
||||||
|
ReadStateMachineScope (state_machine_scope);
|
||||||
|
|
||||||
|
var async_method = custom_infos [i] as AsyncMethodBodyDebugInformation;
|
||||||
|
if (async_method != null)
|
||||||
|
ReadAsyncMethodBody (async_method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadAsyncMethodBody (AsyncMethodBodyDebugInformation async_method)
|
||||||
|
{
|
||||||
|
if (async_method.catch_handler.Offset > -1)
|
||||||
|
async_method.catch_handler = new InstructionOffset (GetInstruction (async_method.catch_handler.Offset));
|
||||||
|
|
||||||
|
if (!async_method.yields.IsNullOrEmpty ())
|
||||||
|
for (int i = 0; i < async_method.yields.Count; i++)
|
||||||
|
async_method.yields [i] = new InstructionOffset (GetInstruction (async_method.yields [i].Offset));
|
||||||
|
|
||||||
|
if (!async_method.resumes.IsNullOrEmpty ())
|
||||||
|
for (int i = 0; i < async_method.resumes.Count; i++)
|
||||||
|
async_method.resumes [i] = new InstructionOffset (GetInstruction (async_method.resumes [i].Offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadStateMachineScope (StateMachineScopeDebugInformation state_machine_scope)
|
||||||
|
{
|
||||||
|
if (state_machine_scope.scopes.IsNullOrEmpty ())
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var scope in state_machine_scope.scopes) {
|
||||||
|
scope.start = new InstructionOffset (GetInstruction (scope.start.Offset));
|
||||||
|
|
||||||
|
var end_instruction = GetInstruction (scope.end.Offset);
|
||||||
|
scope.end = end_instruction == null
|
||||||
|
? new InstructionOffset ()
|
||||||
|
: new InstructionOffset (end_instruction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadSequencePoints ()
|
||||||
|
{
|
||||||
|
var symbol = method.debug_info;
|
||||||
|
|
||||||
|
for (int i = 0; i < symbol.sequence_points.Count; i++) {
|
||||||
|
var sequence_point = symbol.sequence_points [i];
|
||||||
|
var instruction = GetInstruction (sequence_point.Offset);
|
||||||
|
if (instruction != null)
|
||||||
|
sequence_point.offset = new InstructionOffset (instruction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadScopes (Collection<ScopeDebugInformation> scopes)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < scopes.Count; i++)
|
||||||
|
ReadScope (scopes [i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadScope (ScopeDebugInformation scope)
|
||||||
|
{
|
||||||
|
var start_instruction = GetInstruction (scope.Start.Offset);
|
||||||
|
if (start_instruction != null)
|
||||||
|
scope.Start = new InstructionOffset (start_instruction);
|
||||||
|
|
||||||
|
var end_instruction = GetInstruction (scope.End.Offset);
|
||||||
|
scope.End = end_instruction != null
|
||||||
|
? new InstructionOffset (end_instruction)
|
||||||
|
: new InstructionOffset ();
|
||||||
|
|
||||||
|
if (!scope.variables.IsNullOrEmpty ()) {
|
||||||
|
for (int i = 0; i < scope.variables.Count; i++) {
|
||||||
|
var variable_info = scope.variables [i];
|
||||||
|
var variable = GetVariable (variable_info.Index);
|
||||||
|
if (variable != null)
|
||||||
|
variable_info.index = new VariableIndex (variable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!scope.scopes.IsNullOrEmpty ())
|
||||||
|
ReadScopes (scope.scopes);
|
||||||
|
}
|
||||||
|
|
||||||
#if !READ_ONLY
|
#if !READ_ONLY
|
||||||
|
|
||||||
public ByteBuffer PatchRawMethodBody (MethodDefinition method, CodeWriter writer, out int code_size, out MetadataToken local_var_token)
|
public ByteBuffer PatchRawMethodBody (MethodDefinition method, CodeWriter writer, out int code_size, out MetadataToken local_var_token)
|
||||||
|
51
external/cecil/Mono.Cecil.Cil/Symbols.cs
vendored
51
external/cecil/Mono.Cecil.Cil/Symbols.cs
vendored
@ -479,7 +479,7 @@ namespace Mono.Cecil.Cil {
|
|||||||
internal InstructionOffset catch_handler;
|
internal InstructionOffset catch_handler;
|
||||||
internal Collection<InstructionOffset> yields;
|
internal Collection<InstructionOffset> yields;
|
||||||
internal Collection<InstructionOffset> resumes;
|
internal Collection<InstructionOffset> resumes;
|
||||||
internal MethodDefinition move_next;
|
internal Collection<MethodDefinition> resume_methods;
|
||||||
|
|
||||||
public InstructionOffset CatchHandler {
|
public InstructionOffset CatchHandler {
|
||||||
get { return catch_handler; }
|
get { return catch_handler; }
|
||||||
@ -494,9 +494,8 @@ namespace Mono.Cecil.Cil {
|
|||||||
get { return resumes ?? (resumes = new Collection<InstructionOffset> ()); }
|
get { return resumes ?? (resumes = new Collection<InstructionOffset> ()); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MethodDefinition MoveNextMethod {
|
public Collection<MethodDefinition> ResumeMethods {
|
||||||
get { return move_next; }
|
get { return resume_methods ?? (resume_methods = new Collection<MethodDefinition> ()); }
|
||||||
set { move_next = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override CustomDebugInformationKind Kind {
|
public override CustomDebugInformationKind Kind {
|
||||||
@ -524,7 +523,7 @@ namespace Mono.Cecil.Cil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class StateMachineScopeDebugInformation : CustomDebugInformation {
|
public sealed class StateMachineScope {
|
||||||
|
|
||||||
internal InstructionOffset start;
|
internal InstructionOffset start;
|
||||||
internal InstructionOffset end;
|
internal InstructionOffset end;
|
||||||
@ -539,24 +538,36 @@ namespace Mono.Cecil.Cil {
|
|||||||
set { end = value; }
|
set { end = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal StateMachineScope (int start, int end)
|
||||||
|
{
|
||||||
|
this.start = new InstructionOffset (start);
|
||||||
|
this.end = new InstructionOffset (end);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StateMachineScope (Instruction start, Instruction end)
|
||||||
|
{
|
||||||
|
this.start = new InstructionOffset (start);
|
||||||
|
this.end = end != null ? new InstructionOffset (end) : new InstructionOffset ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class StateMachineScopeDebugInformation : CustomDebugInformation {
|
||||||
|
|
||||||
|
internal Collection<StateMachineScope> scopes;
|
||||||
|
|
||||||
|
public Collection<StateMachineScope> Scopes {
|
||||||
|
get { return scopes ?? (scopes = new Collection<StateMachineScope> ()); }
|
||||||
|
}
|
||||||
|
|
||||||
public override CustomDebugInformationKind Kind {
|
public override CustomDebugInformationKind Kind {
|
||||||
get { return CustomDebugInformationKind.StateMachineScope; }
|
get { return CustomDebugInformationKind.StateMachineScope; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Guid KindIdentifier = new Guid ("{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}");
|
public static Guid KindIdentifier = new Guid ("{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}");
|
||||||
|
|
||||||
internal StateMachineScopeDebugInformation (int start, int end)
|
public StateMachineScopeDebugInformation ()
|
||||||
: base (KindIdentifier)
|
: base (KindIdentifier)
|
||||||
{
|
{
|
||||||
this.start = new InstructionOffset (start);
|
|
||||||
this.end = new InstructionOffset (end);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StateMachineScopeDebugInformation (Instruction start, Instruction end)
|
|
||||||
: base (KindIdentifier)
|
|
||||||
{
|
|
||||||
this.start = new InstructionOffset (start);
|
|
||||||
this.end = end != null ? new InstructionOffset (end) : new InstructionOffset ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,8 +682,10 @@ namespace Mono.Cecil.Cil {
|
|||||||
|
|
||||||
var offset_mapping = new Dictionary<int, SequencePoint> (sequence_points.Count);
|
var offset_mapping = new Dictionary<int, SequencePoint> (sequence_points.Count);
|
||||||
|
|
||||||
for (int i = 0; i < sequence_points.Count; i++)
|
for (int i = 0; i < sequence_points.Count; i++) {
|
||||||
offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]);
|
if (!offset_mapping.ContainsKey (sequence_points [i].Offset))
|
||||||
|
offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]);
|
||||||
|
}
|
||||||
|
|
||||||
var instructions = method.Body.Instructions;
|
var instructions = method.Body.Instructions;
|
||||||
|
|
||||||
@ -782,7 +795,7 @@ namespace Mono.Cecil.Cil {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return SymbolProvider.GetReaderProvider (SymbolKind.NativePdb).GetSymbolReader (module, fileName);
|
return SymbolProvider.GetReaderProvider (SymbolKind.NativePdb).GetSymbolReader (module, fileName);
|
||||||
} catch (TypeLoadException) {
|
} catch (Exception) {
|
||||||
// We might not include support for native pdbs.
|
// We might not include support for native pdbs.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -791,7 +804,7 @@ namespace Mono.Cecil.Cil {
|
|||||||
if (File.Exists (mdb_file_name)) {
|
if (File.Exists (mdb_file_name)) {
|
||||||
try {
|
try {
|
||||||
return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, fileName);
|
return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, fileName);
|
||||||
} catch (TypeLoadException) {
|
} catch (Exception) {
|
||||||
// We might not include support for mdbs.
|
// We might not include support for mdbs.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
external/cecil/Mono.Cecil.PE/Image.cs
vendored
1
external/cecil/Mono.Cecil.PE/Image.cs
vendored
@ -39,6 +39,7 @@ namespace Mono.Cecil.PE {
|
|||||||
public uint Timestamp;
|
public uint Timestamp;
|
||||||
public ModuleAttributes Attributes;
|
public ModuleAttributes Attributes;
|
||||||
|
|
||||||
|
public DataDirectory Win32Resources;
|
||||||
public DataDirectory Debug;
|
public DataDirectory Debug;
|
||||||
public DataDirectory Resources;
|
public DataDirectory Resources;
|
||||||
public DataDirectory StrongName;
|
public DataDirectory StrongName;
|
||||||
|
8
external/cecil/Mono.Cecil.PE/ImageReader.cs
vendored
8
external/cecil/Mono.Cecil.PE/ImageReader.cs
vendored
@ -160,12 +160,18 @@ namespace Mono.Cecil.PE {
|
|||||||
|
|
||||||
// ExportTable 8
|
// ExportTable 8
|
||||||
// ImportTable 8
|
// ImportTable 8
|
||||||
|
|
||||||
|
Advance (pe64 ? 56 : 40);
|
||||||
|
|
||||||
// ResourceTable 8
|
// ResourceTable 8
|
||||||
|
|
||||||
|
image.Win32Resources = ReadDataDirectory ();
|
||||||
|
|
||||||
// ExceptionTable 8
|
// ExceptionTable 8
|
||||||
// CertificateTable 8
|
// CertificateTable 8
|
||||||
// BaseRelocationTable 8
|
// BaseRelocationTable 8
|
||||||
|
|
||||||
Advance (pe64 ? 88 : 72);
|
Advance (24);
|
||||||
|
|
||||||
// Debug 8
|
// Debug 8
|
||||||
image.Debug = ReadDataDirectory ();
|
image.Debug = ReadDataDirectory ();
|
||||||
|
22
external/cecil/Mono.Cecil.PE/ImageWriter.cs
vendored
22
external/cecil/Mono.Cecil.PE/ImageWriter.cs
vendored
@ -87,21 +87,15 @@ namespace Mono.Cecil.PE {
|
|||||||
|
|
||||||
void GetWin32Resources ()
|
void GetWin32Resources ()
|
||||||
{
|
{
|
||||||
var rsrc = GetImageResourceSection ();
|
if (!module.HasImage)
|
||||||
if (rsrc == null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
win32_resources = module.Image.GetReaderAt (rsrc.VirtualAddress, rsrc.SizeOfRawData, (s, reader) => new ByteBuffer (reader.ReadBytes ((int) s)));
|
DataDirectory win32_resources_directory = module.Image.Win32Resources;
|
||||||
}
|
var size = win32_resources_directory.Size;
|
||||||
|
|
||||||
Section GetImageResourceSection ()
|
if (size > 0) {
|
||||||
{
|
win32_resources = module.Image.GetReaderAt (win32_resources_directory.VirtualAddress, size, (s, reader) => new ByteBuffer (reader.ReadBytes ((int) s)));
|
||||||
if (!module.HasImage)
|
}
|
||||||
return null;
|
|
||||||
|
|
||||||
const string rsrc_section = ".rsrc";
|
|
||||||
|
|
||||||
return module.Image.GetSection (rsrc_section);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageWriter CreateWriter (ModuleDefinition module, MetadataBuilder metadata, Disposable<Stream> stream)
|
public static ImageWriter CreateWriter (ModuleDefinition module, MetadataBuilder metadata, Disposable<Stream> stream)
|
||||||
@ -846,10 +840,10 @@ namespace Mono.Cecil.PE {
|
|||||||
|
|
||||||
void PatchResourceDataEntry (ByteBuffer resources)
|
void PatchResourceDataEntry (ByteBuffer resources)
|
||||||
{
|
{
|
||||||
var old_rsrc = GetImageResourceSection ();
|
|
||||||
var rva = resources.ReadUInt32 ();
|
var rva = resources.ReadUInt32 ();
|
||||||
resources.position -= 4;
|
resources.position -= 4;
|
||||||
resources.WriteUInt32 (rva - old_rsrc.VirtualAddress + rsrc.VirtualAddress);
|
|
||||||
|
resources.WriteUInt32 (rva - module.Image.Win32Resources.VirtualAddress + rsrc.VirtualAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27
external/cecil/Mono.Cecil.Tests.props
vendored
27
external/cecil/Mono.Cecil.Tests.props
vendored
@ -2,9 +2,24 @@
|
|||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BuildDirectory>$(MSBuildProjectDirectory)</BuildDirectory>
|
<BuildDirectory>$(MSBuildProjectDirectory)</BuildDirectory>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="Mono.Cecil.props" />
|
<Import Project="Mono.Cecil.props" />
|
||||||
<ItemGroup>
|
<PropertyGroup Condition="'$(NetStandard)' == 'true'">
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Condition="'$(NetStandard)' == 'true'">
|
||||||
|
<PackageReference Include="NUnit">
|
||||||
|
<Version>3.7.1</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||||
|
<Version>15.3.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="NUnit3TestAdapter">
|
||||||
|
<Version>3.8.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="'$(NetStandard)' != 'true'">
|
||||||
<Reference Include="nunit.core">
|
<Reference Include="nunit.core">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>$(MSBuildThisFileDirectory)\Test\libs\nunit-2.6.2\nunit.core.dll</HintPath>
|
<HintPath>$(MSBuildThisFileDirectory)\Test\libs\nunit-2.6.2\nunit.core.dll</HintPath>
|
||||||
@ -18,4 +33,14 @@
|
|||||||
<HintPath>$(MSBuildThisFileDirectory)\Test\libs\nunit-2.6.2\nunit.framework.dll</HintPath>
|
<HintPath>$(MSBuildThisFileDirectory)\Test\libs\nunit-2.6.2\nunit.framework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<!-- Workaround for https://github.com/Microsoft/msbuild/issues/1310 -->
|
||||||
|
<Target Name="ForceGenerationOfBindingRedirects"
|
||||||
|
AfterTargets="ResolveAssemblyReferences"
|
||||||
|
BeforeTargets="GenerateBindingRedirects"
|
||||||
|
Condition="'$(AutoGenerateBindingRedirects)' == 'true'">
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Needs to be set in a target because it has to be set after the initial evaluation in the common targets -->
|
||||||
|
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
2
external/cecil/Mono.Cecil.nuspec
vendored
2
external/cecil/Mono.Cecil.nuspec
vendored
@ -2,7 +2,7 @@
|
|||||||
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<id>Mono.Cecil</id>
|
<id>Mono.Cecil</id>
|
||||||
<version>0.10.0.0-beta6</version>
|
<version>0.10.0.0-beta7</version>
|
||||||
<title>Mono.Cecil</title>
|
<title>Mono.Cecil</title>
|
||||||
<authors>Jb Evain</authors>
|
<authors>Jb Evain</authors>
|
||||||
<owners>Jb Evain</owners>
|
<owners>Jb Evain</owners>
|
||||||
|
11
external/cecil/Mono.Cecil.props
vendored
11
external/cecil/Mono.Cecil.props
vendored
@ -36,18 +36,19 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" $(Configuration.StartsWith('net_3_5')) ">
|
<PropertyGroup Condition=" $(Configuration.StartsWith('net_3_5')) ">
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
<DefineConstants>$(DefineConstants);</DefineConstants>
|
<DefineConstants>$(DefineConstants);NET_3_5;</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" $(Configuration.StartsWith('net_4_0')) ">
|
<PropertyGroup Condition=" $(Configuration.StartsWith('net_4_0')) ">
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<DefineConstants>$(DefineConstants);NET_4_0;</DefineConstants>
|
<DefineConstants>$(DefineConstants);NET_4_0;</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" $(NetStandard) ">
|
<PropertyGroup Condition="'$(NetStandard)' == 'true'">
|
||||||
<TargetFramework>netstandard1.3</TargetFramework>
|
<TargetFramework Condition="'$(IsTestProject)' == 'true'">netcoreapp2.0</TargetFramework>
|
||||||
|
<TargetFramework Condition="'$(IsTestProject)' != 'true'">netstandard1.3</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="NetStandard.props" Condition=" $(NetStandard) " />
|
<Import Project="NetStandard.props" Condition="'$(NetStandard)' == 'true'" />
|
||||||
<!-- Shared References -->
|
<!-- Shared References -->
|
||||||
<ItemGroup Condition=" ! $(NetStandard) ">
|
<ItemGroup Condition="'$(NetStandard)' != 'true'">
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
20
external/cecil/Mono.Cecil.sln
vendored
20
external/cecil/Mono.Cecil.sln
vendored
@ -1,6 +1,6 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 14
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 14.0.25420.1
|
VisualStudioVersion = 15.0.26927.1
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74E5ECE0-06B4-401C-AEBA-E8DD53E17943}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74E5ECE0-06B4-401C-AEBA-E8DD53E17943}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -22,6 +22,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Rocks.Tests", "r
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Rocks", "rocks\Mono.Cecil.Rocks.csproj", "{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Rocks", "rocks\Mono.Cecil.Rocks.csproj", "{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E0893F44-CB9F-49C5-B38C-70082EFC5072}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.editorconfig = .editorconfig
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
net_3_5_Debug_ReadOnly|Any CPU = net_3_5_Debug_ReadOnly|Any CPU
|
net_3_5_Debug_ReadOnly|Any CPU = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
@ -81,9 +86,11 @@ Global
|
|||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug_ReadOnly|Any CPU.Build.0 = netstandard_Debug_ReadOnly|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug_ReadOnly|Any CPU.Build.0 = netstandard_Debug_ReadOnly|Any CPU
|
||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
||||||
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU
|
||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release_ReadOnly|Any CPU.Build.0 = netstandard_Release_ReadOnly|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release_ReadOnly|Any CPU.Build.0 = netstandard_Release_ReadOnly|Any CPU
|
||||||
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
||||||
|
{A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release|Any CPU.Build.0 = netstandard_Release|Any CPU
|
||||||
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU
|
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU
|
||||||
@ -125,10 +132,8 @@ Global
|
|||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug_ReadOnly|Any CPU.Build.0 = netstandard_Debug_ReadOnly|Any CPU
|
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release_ReadOnly|Any CPU.Build.0 = netstandard_Release_ReadOnly|Any CPU
|
|
||||||
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
{AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
||||||
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
@ -171,10 +176,8 @@ Global
|
|||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug_ReadOnly|Any CPU.Build.0 = netstandard_Debug_ReadOnly|Any CPU
|
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release_ReadOnly|Any CPU.Build.0 = netstandard_Release_ReadOnly|Any CPU
|
|
||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
@ -193,10 +196,8 @@ Global
|
|||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug_ReadOnly|Any CPU.ActiveCfg = netstandard_Debug_ReadOnly|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug_ReadOnly|Any CPU.Build.0 = netstandard_Debug_ReadOnly|Any CPU
|
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release_ReadOnly|Any CPU.ActiveCfg = netstandard_Release_ReadOnly|Any CPU
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release_ReadOnly|Any CPU.Build.0 = netstandard_Release_ReadOnly|Any CPU
|
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
|
||||||
{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug_ReadOnly|Any CPU.ActiveCfg = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
{FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug_ReadOnly|Any CPU.Build.0 = net_3_5_Debug_ReadOnly|Any CPU
|
||||||
@ -234,4 +235,7 @@ Global
|
|||||||
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA} = {74E5ECE0-06B4-401C-AEBA-E8DD53E17943}
|
{29300103-CB76-4A1D-B6FD-FFD91C1EC8AA} = {74E5ECE0-06B4-401C-AEBA-E8DD53E17943}
|
||||||
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52} = {74E5ECE0-06B4-401C-AEBA-E8DD53E17943}
|
{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52} = {74E5ECE0-06B4-401C-AEBA-E8DD53E17943}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {D75C0801-AFCB-4B1F-90AD-2B7852A74E6A}
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
92
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
92
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
@ -156,7 +156,6 @@ namespace Mono.Cecil {
|
|||||||
this.module.Read (this.module, (module, reader) => {
|
this.module.Read (this.module, (module, reader) => {
|
||||||
ReadModuleManifest (reader);
|
ReadModuleManifest (reader);
|
||||||
ReadModule (module, resolve_attributes: true);
|
ReadModule (module, resolve_attributes: true);
|
||||||
return module;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,10 +421,7 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
protected override void ReadModule ()
|
protected override void ReadModule ()
|
||||||
{
|
{
|
||||||
this.module.Read (this.module, (module, reader) => {
|
this.module.Read (this.module, (_, reader) => ReadModuleManifest (reader));
|
||||||
ReadModuleManifest (reader);
|
|
||||||
return module;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReadSymbols (ModuleDefinition module)
|
public override void ReadSymbols (ModuleDefinition module)
|
||||||
@ -943,8 +939,8 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
type.BaseType = GetTypeDefOrRef (ReadMetadataToken (CodedIndex.TypeDefOrRef));
|
type.BaseType = GetTypeDefOrRef (ReadMetadataToken (CodedIndex.TypeDefOrRef));
|
||||||
|
|
||||||
type.fields_range = ReadFieldsRange (rid);
|
type.fields_range = ReadListRange (rid, Table.TypeDef, Table.Field);
|
||||||
type.methods_range = ReadMethodsRange (rid);
|
type.methods_range = ReadListRange (rid, Table.TypeDef, Table.Method);
|
||||||
|
|
||||||
if (IsNested (attributes))
|
if (IsNested (attributes))
|
||||||
type.DeclaringType = GetNestedTypeDeclaringType (type);
|
type.DeclaringType = GetNestedTypeDeclaringType (type);
|
||||||
@ -965,21 +961,13 @@ namespace Mono.Cecil {
|
|||||||
return GetTypeDefinition (declaring_rid);
|
return GetTypeDefinition (declaring_rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Range ReadFieldsRange (uint type_index)
|
|
||||||
{
|
|
||||||
return ReadListRange (type_index, Table.TypeDef, Table.Field);
|
|
||||||
}
|
|
||||||
|
|
||||||
Range ReadMethodsRange (uint type_index)
|
|
||||||
{
|
|
||||||
return ReadListRange (type_index, Table.TypeDef, Table.Method);
|
|
||||||
}
|
|
||||||
|
|
||||||
Range ReadListRange (uint current_index, Table current, Table target)
|
Range ReadListRange (uint current_index, Table current, Table target)
|
||||||
{
|
{
|
||||||
var list = new Range ();
|
var list = new Range ();
|
||||||
|
|
||||||
list.Start = ReadTableIndex (target);
|
var start = ReadTableIndex (target);
|
||||||
|
if (start == 0)
|
||||||
|
return list;
|
||||||
|
|
||||||
uint next_index;
|
uint next_index;
|
||||||
var current_table = image.TableHeap [current];
|
var current_table = image.TableHeap [current];
|
||||||
@ -993,7 +981,8 @@ namespace Mono.Cecil {
|
|||||||
this.position = position;
|
this.position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
list.Length = next_index - list.Start;
|
list.Start = start;
|
||||||
|
list.Length = next_index - start;
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -1496,16 +1485,11 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
for (uint i = 1; i <= length; i++) {
|
for (uint i = 1; i <= length; i++) {
|
||||||
var type_rid = ReadTableIndex (Table.TypeDef);
|
var type_rid = ReadTableIndex (Table.TypeDef);
|
||||||
Range events_range = ReadEventsRange (i);
|
Range events_range = ReadListRange (i, Table.EventMap, Table.Event);
|
||||||
metadata.AddEventsRange (type_rid, events_range);
|
metadata.AddEventsRange (type_rid, events_range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Range ReadEventsRange (uint rid)
|
|
||||||
{
|
|
||||||
return ReadListRange (rid, Table.EventMap, Table.Event);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasProperties (TypeDefinition type)
|
public bool HasProperties (TypeDefinition type)
|
||||||
{
|
{
|
||||||
InitializeProperties ();
|
InitializeProperties ();
|
||||||
@ -1585,16 +1569,11 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
for (uint i = 1; i <= length; i++) {
|
for (uint i = 1; i <= length; i++) {
|
||||||
var type_rid = ReadTableIndex (Table.TypeDef);
|
var type_rid = ReadTableIndex (Table.TypeDef);
|
||||||
var properties_range = ReadPropertiesRange (i);
|
var properties_range = ReadListRange (i, Table.PropertyMap, Table.Property);
|
||||||
metadata.AddPropertiesRange (type_rid, properties_range);
|
metadata.AddPropertiesRange (type_rid, properties_range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Range ReadPropertiesRange (uint rid)
|
|
||||||
{
|
|
||||||
return ReadListRange (rid, Table.PropertyMap, Table.Property);
|
|
||||||
}
|
|
||||||
|
|
||||||
MethodSemanticsAttributes ReadMethodSemantics (MethodDefinition method)
|
MethodSemanticsAttributes ReadMethodSemantics (MethodDefinition method)
|
||||||
{
|
{
|
||||||
InitializeMethodSemantics ();
|
InitializeMethodSemantics ();
|
||||||
@ -1697,23 +1676,19 @@ namespace Mono.Cecil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PropertyDefinition ReadMethods (PropertyDefinition property)
|
public void ReadMethods (PropertyDefinition property)
|
||||||
{
|
{
|
||||||
ReadAllSemantics (property.DeclaringType);
|
ReadAllSemantics (property.DeclaringType);
|
||||||
return property;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventDefinition ReadMethods (EventDefinition @event)
|
public void ReadMethods (EventDefinition @event)
|
||||||
{
|
{
|
||||||
ReadAllSemantics (@event.DeclaringType);
|
ReadAllSemantics (@event.DeclaringType);
|
||||||
return @event;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MethodSemanticsAttributes ReadAllSemantics (MethodDefinition method)
|
public void ReadAllSemantics (MethodDefinition method)
|
||||||
{
|
{
|
||||||
ReadAllSemantics (method.DeclaringType);
|
ReadAllSemantics (method.DeclaringType);
|
||||||
|
|
||||||
return method.SemanticsAttributes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadAllSemantics (TypeDefinition type)
|
void ReadAllSemantics (TypeDefinition type)
|
||||||
@ -1729,11 +1704,6 @@ namespace Mono.Cecil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Range ReadParametersRange (uint method_rid)
|
|
||||||
{
|
|
||||||
return ReadListRange (method_rid, Table.Method, Table.Param);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection<MethodDefinition> ReadMethods (TypeDefinition type)
|
public Collection<MethodDefinition> ReadMethods (TypeDefinition type)
|
||||||
{
|
{
|
||||||
var methods_range = type.methods_range;
|
var methods_range = type.methods_range;
|
||||||
@ -1794,7 +1764,7 @@ namespace Mono.Cecil {
|
|||||||
methods.Add (method); // attach method
|
methods.Add (method); // attach method
|
||||||
|
|
||||||
var signature = ReadBlobIndex ();
|
var signature = ReadBlobIndex ();
|
||||||
var param_range = ReadParametersRange (method_rid);
|
var param_range = ReadListRange (method_rid, Table.Method, Table.Param);
|
||||||
|
|
||||||
this.context = method;
|
this.context = method;
|
||||||
|
|
||||||
@ -2121,6 +2091,11 @@ namespace Mono.Cecil {
|
|||||||
return code.ReadMethodBody (method);
|
return code.ReadMethodBody (method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ReadCodeSize (MethodDefinition method)
|
||||||
|
{
|
||||||
|
return code.ReadCodeSize (method);
|
||||||
|
}
|
||||||
|
|
||||||
public CallSite ReadCallSite (MetadataToken token)
|
public CallSite ReadCallSite (MetadataToken token)
|
||||||
{
|
{
|
||||||
if (!MoveTo (Table.StandAloneSig, token.RID))
|
if (!MoveTo (Table.StandAloneSig, token.RID))
|
||||||
@ -2387,8 +2362,8 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
var type_system = module.TypeSystem;
|
var type_system = module.TypeSystem;
|
||||||
|
|
||||||
var context = new MethodReference (string.Empty, type_system.Void);
|
var context = new MethodDefinition (string.Empty, MethodAttributes.Static, type_system.Void);
|
||||||
context.DeclaringType = new TypeReference (string.Empty, string.Empty, module, type_system.CoreLibrary);
|
context.DeclaringType = new TypeDefinition (string.Empty, string.Empty, TypeAttributes.Public);
|
||||||
|
|
||||||
var member_references = new MemberReference [length];
|
var member_references = new MemberReference [length];
|
||||||
|
|
||||||
@ -3183,25 +3158,36 @@ namespace Mono.Cecil {
|
|||||||
for (int i = 0; i < rows.Length; i++) {
|
for (int i = 0; i < rows.Length; i++) {
|
||||||
if (rows [i].Col1 == StateMachineScopeDebugInformation.KindIdentifier) {
|
if (rows [i].Col1 == StateMachineScopeDebugInformation.KindIdentifier) {
|
||||||
var signature = ReadSignature (rows [i].Col2);
|
var signature = ReadSignature (rows [i].Col2);
|
||||||
infos.Add (new StateMachineScopeDebugInformation (signature.ReadInt32 (), signature.ReadInt32 ()));
|
var scopes = new Collection<StateMachineScope> ();
|
||||||
|
|
||||||
|
while (signature.CanReadMore ()) {
|
||||||
|
var start = signature.ReadInt32 ();
|
||||||
|
var end = start + signature.ReadInt32 ();
|
||||||
|
scopes.Add (new StateMachineScope (start, end));
|
||||||
|
}
|
||||||
|
|
||||||
|
var state_machine = new StateMachineScopeDebugInformation ();
|
||||||
|
state_machine.scopes = scopes;
|
||||||
|
|
||||||
|
infos.Add (state_machine);
|
||||||
} else if (rows [i].Col1 == AsyncMethodBodyDebugInformation.KindIdentifier) {
|
} else if (rows [i].Col1 == AsyncMethodBodyDebugInformation.KindIdentifier) {
|
||||||
var signature = ReadSignature (rows [i].Col2);
|
var signature = ReadSignature (rows [i].Col2);
|
||||||
|
|
||||||
var catch_offset = signature.ReadInt32 () - 1;
|
var catch_offset = signature.ReadInt32 () - 1;
|
||||||
var yields = new Collection<InstructionOffset> ();
|
var yields = new Collection<InstructionOffset> ();
|
||||||
var resumes = new Collection<InstructionOffset> ();
|
var resumes = new Collection<InstructionOffset> ();
|
||||||
uint move_next_rid = 0;
|
var resume_methods = new Collection<MethodDefinition> ();
|
||||||
|
|
||||||
while (signature.CanReadMore ()) {
|
while (signature.CanReadMore ()) {
|
||||||
yields.Add (new InstructionOffset (signature.ReadInt32 ()));
|
yields.Add (new InstructionOffset (signature.ReadInt32 ()));
|
||||||
resumes.Add (new InstructionOffset (signature.ReadInt32 ()));
|
resumes.Add (new InstructionOffset (signature.ReadInt32 ()));
|
||||||
move_next_rid = signature.ReadCompressedUInt32 ();
|
resume_methods.Add (GetMethodDefinition (signature.ReadCompressedUInt32 ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
var async_body = new AsyncMethodBodyDebugInformation (catch_offset);
|
var async_body = new AsyncMethodBodyDebugInformation (catch_offset);
|
||||||
async_body.yields = yields;
|
async_body.yields = yields;
|
||||||
async_body.resumes = resumes;
|
async_body.resumes = resumes;
|
||||||
async_body.move_next = GetMethodDefinition (move_next_rid);
|
async_body.resume_methods = resume_methods;
|
||||||
|
|
||||||
infos.Add (async_body);
|
infos.Add (async_body);
|
||||||
} else if (rows [i].Col1 == EmbeddedSourceDebugInformation.KindIdentifier) {
|
} else if (rows [i].Col1 == EmbeddedSourceDebugInformation.KindIdentifier) {
|
||||||
@ -3370,7 +3356,7 @@ namespace Mono.Cecil {
|
|||||||
switch (etype) {
|
switch (etype) {
|
||||||
case ElementType.ValueType: {
|
case ElementType.ValueType: {
|
||||||
var value_type = GetTypeDefOrRef (ReadTypeTokenSignature ());
|
var value_type = GetTypeDefOrRef (ReadTypeTokenSignature ());
|
||||||
value_type.IsValueType = true;
|
value_type.KnownValueType ();
|
||||||
return value_type;
|
return value_type;
|
||||||
}
|
}
|
||||||
case ElementType.Class:
|
case ElementType.Class:
|
||||||
@ -3410,8 +3396,8 @@ namespace Mono.Cecil {
|
|||||||
ReadGenericInstanceSignature (element_type, generic_instance);
|
ReadGenericInstanceSignature (element_type, generic_instance);
|
||||||
|
|
||||||
if (is_value_type) {
|
if (is_value_type) {
|
||||||
generic_instance.IsValueType = true;
|
generic_instance.KnownValueType ();
|
||||||
element_type.GetElementType ().IsValueType = true;
|
element_type.GetElementType ().KnownValueType ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return generic_instance;
|
return generic_instance;
|
||||||
|
18
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
18
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
@ -2392,13 +2392,19 @@ namespace Mono.Cecil {
|
|||||||
var method_info = ((MethodDefinition) provider).DebugInformation;
|
var method_info = ((MethodDefinition) provider).DebugInformation;
|
||||||
|
|
||||||
var signature = CreateSignatureWriter ();
|
var signature = CreateSignatureWriter ();
|
||||||
signature.WriteUInt32 ((uint) state_machine_scope.Start.Offset);
|
|
||||||
|
|
||||||
var end_offset = state_machine_scope.End.IsEndOfMethod
|
var scopes = state_machine_scope.Scopes;
|
||||||
? method_info.code_size
|
|
||||||
: state_machine_scope.End.Offset;
|
|
||||||
|
|
||||||
signature.WriteUInt32 ((uint) (end_offset - state_machine_scope.Start.Offset));
|
for (int i = 0; i < scopes.Count; i++) {
|
||||||
|
var scope = scopes [i];
|
||||||
|
signature.WriteUInt32 ((uint) scope.Start.Offset);
|
||||||
|
|
||||||
|
var end_offset = scope.End.IsEndOfMethod
|
||||||
|
? method_info.code_size
|
||||||
|
: scope.End.Offset;
|
||||||
|
|
||||||
|
signature.WriteUInt32 ((uint) (end_offset - scope.Start.Offset));
|
||||||
|
}
|
||||||
|
|
||||||
AddCustomDebugInformation (provider, state_machine_scope, signature);
|
AddCustomDebugInformation (provider, state_machine_scope, signature);
|
||||||
}
|
}
|
||||||
@ -2411,7 +2417,7 @@ namespace Mono.Cecil {
|
|||||||
for (int i = 0; i < async_method.yields.Count; i++) {
|
for (int i = 0; i < async_method.yields.Count; i++) {
|
||||||
signature.WriteUInt32 ((uint) async_method.yields [i].Offset);
|
signature.WriteUInt32 ((uint) async_method.yields [i].Offset);
|
||||||
signature.WriteUInt32 ((uint) async_method.resumes [i].Offset);
|
signature.WriteUInt32 ((uint) async_method.resumes [i].Offset);
|
||||||
signature.WriteCompressedUInt32 (async_method.move_next.MetadataToken.RID);
|
signature.WriteCompressedUInt32 (async_method.resume_methods [i].MetadataToken.RID);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddCustomDebugInformation (provider, async_method, signature);
|
AddCustomDebugInformation (provider, async_method, signature);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Mono.Collections.Generic;
|
using Mono.Collections.Generic;
|
||||||
@ -65,14 +66,19 @@ namespace Mono.Cecil {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !NET_CORE
|
|
||||||
public abstract class BaseAssemblyResolver : IAssemblyResolver {
|
public abstract class BaseAssemblyResolver : IAssemblyResolver {
|
||||||
|
|
||||||
static readonly bool on_mono = Type.GetType ("Mono.Runtime") != null;
|
static readonly bool on_mono = Type.GetType ("Mono.Runtime") != null;
|
||||||
|
|
||||||
readonly Collection<string> directories;
|
readonly Collection<string> directories;
|
||||||
|
|
||||||
|
#if NET_CORE
|
||||||
|
// Maps file names of available trusted platform assemblies to their full paths.
|
||||||
|
// Internal for testing.
|
||||||
|
internal static readonly Lazy<Dictionary<string, string>> TrustedPlatformAssemblies = new Lazy<Dictionary<string, string>> (CreateTrustedPlatformAssemblyMap);
|
||||||
|
#else
|
||||||
Collection<string> gac_paths;
|
Collection<string> gac_paths;
|
||||||
|
#endif
|
||||||
|
|
||||||
public void AddSearchDirectory (string directory)
|
public void AddSearchDirectory (string directory)
|
||||||
{
|
{
|
||||||
@ -127,6 +133,11 @@ namespace Mono.Cecil {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NET_CORE
|
||||||
|
assembly = SearchTrustedPlatformAssemblies (name, parameters);
|
||||||
|
if (assembly != null)
|
||||||
|
return assembly;
|
||||||
|
#else
|
||||||
var framework_dir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName);
|
var framework_dir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName);
|
||||||
var framework_dirs = on_mono
|
var framework_dirs = on_mono
|
||||||
? new [] { framework_dir, Path.Combine (framework_dir, "Facades") }
|
? new [] { framework_dir, Path.Combine (framework_dir, "Facades") }
|
||||||
@ -151,7 +162,7 @@ namespace Mono.Cecil {
|
|||||||
assembly = SearchDirectory (name, framework_dirs, parameters);
|
assembly = SearchDirectory (name, framework_dirs, parameters);
|
||||||
if (assembly != null)
|
if (assembly != null)
|
||||||
return assembly;
|
return assembly;
|
||||||
|
#endif
|
||||||
if (ResolveFailure != null) {
|
if (ResolveFailure != null) {
|
||||||
assembly = ResolveFailure (this, name);
|
assembly = ResolveFailure (this, name);
|
||||||
if (assembly != null)
|
if (assembly != null)
|
||||||
@ -161,7 +172,45 @@ namespace Mono.Cecil {
|
|||||||
throw new AssemblyResolutionException (name);
|
throw new AssemblyResolutionException (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
AssemblyDefinition SearchDirectory (AssemblyNameReference name, IEnumerable<string> directories, ReaderParameters parameters)
|
#if NET_CORE
|
||||||
|
AssemblyDefinition SearchTrustedPlatformAssemblies (AssemblyNameReference name, ReaderParameters parameters)
|
||||||
|
{
|
||||||
|
if (name.IsWindowsRuntime)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (TrustedPlatformAssemblies.Value.TryGetValue (name.Name, out string path))
|
||||||
|
return GetAssembly (path, parameters);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Dictionary<string, string> CreateTrustedPlatformAssemblyMap ()
|
||||||
|
{
|
||||||
|
var result = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
string paths;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// AppContext is only available on platforms that implement .NET Standard 1.6
|
||||||
|
var appContextType = Type.GetType ("System.AppContext, System.AppContext, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false);
|
||||||
|
var getData = appContextType?.GetTypeInfo ().GetDeclaredMethod ("GetData");
|
||||||
|
paths = (string) getData?.Invoke (null, new [] { "TRUSTED_PLATFORM_ASSEMBLIES" });
|
||||||
|
} catch {
|
||||||
|
paths = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paths == null)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
foreach (var path in paths.Split (Path.PathSeparator))
|
||||||
|
if (string.Equals (Path.GetExtension (path), ".dll", StringComparison.OrdinalIgnoreCase))
|
||||||
|
result [Path.GetFileNameWithoutExtension (path)] = path;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected virtual AssemblyDefinition SearchDirectory (AssemblyNameReference name, IEnumerable<string> directories, ReaderParameters parameters)
|
||||||
{
|
{
|
||||||
var extensions = name.IsWindowsRuntime ? new [] { ".winmd", ".dll" } : new [] { ".exe", ".dll" };
|
var extensions = name.IsWindowsRuntime ? new [] { ".winmd", ".dll" } : new [] { ".exe", ".dll" };
|
||||||
foreach (var directory in directories) {
|
foreach (var directory in directories) {
|
||||||
@ -185,11 +234,11 @@ namespace Mono.Cecil {
|
|||||||
return version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0;
|
return version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !NET_CORE
|
||||||
AssemblyDefinition GetCorlib (AssemblyNameReference reference, ReaderParameters parameters)
|
AssemblyDefinition GetCorlib (AssemblyNameReference reference, ReaderParameters parameters)
|
||||||
{
|
{
|
||||||
var version = reference.Version;
|
var version = reference.Version;
|
||||||
var corlib = typeof (object).Assembly.GetName ();
|
var corlib = typeof (object).Assembly.GetName ();
|
||||||
|
|
||||||
if (corlib.Version == version || IsZero (version))
|
if (corlib.Version == version || IsZero (version))
|
||||||
return GetAssembly (typeof (object).Module.FullyQualifiedName, parameters);
|
return GetAssembly (typeof (object).Module.FullyQualifiedName, parameters);
|
||||||
|
|
||||||
@ -325,7 +374,7 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static string GetAssemblyFile (AssemblyNameReference reference, string prefix, string gac)
|
static string GetAssemblyFile (AssemblyNameReference reference, string prefix, string gac)
|
||||||
{
|
{
|
||||||
var gac_folder = new StringBuilder ()
|
var gac_folder = new StringBuilder ()
|
||||||
@ -352,5 +401,4 @@ namespace Mono.Cecil {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
3
external/cecil/Mono.Cecil/CustomAttribute.cs
vendored
3
external/cecil/Mono.Cecil/CustomAttribute.cs
vendored
@ -62,8 +62,10 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
bool HasFields { get; }
|
bool HasFields { get; }
|
||||||
bool HasProperties { get; }
|
bool HasProperties { get; }
|
||||||
|
bool HasConstructorArguments { get; }
|
||||||
Collection<CustomAttributeNamedArgument> Fields { get; }
|
Collection<CustomAttributeNamedArgument> Fields { get; }
|
||||||
Collection<CustomAttributeNamedArgument> Properties { get; }
|
Collection<CustomAttributeNamedArgument> Properties { get; }
|
||||||
|
Collection<CustomAttributeArgument> ConstructorArguments { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class CustomAttribute : ICustomAttribute {
|
public sealed class CustomAttribute : ICustomAttribute {
|
||||||
@ -196,7 +198,6 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
resolved = false;
|
resolved = false;
|
||||||
}
|
}
|
||||||
return this;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
// Licensed under the MIT/X11 license.
|
// Licensed under the MIT/X11 license.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !NET_CORE
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -61,5 +59,3 @@ namespace Mono.Cecil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -143,9 +143,9 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
public MethodBody Body {
|
public MethodBody Body {
|
||||||
get {
|
get {
|
||||||
MethodBody localBody = this.body;
|
var local = this.body;
|
||||||
if (localBody != null)
|
if (local != null)
|
||||||
return localBody;
|
return local;
|
||||||
|
|
||||||
if (!HasBody)
|
if (!HasBody)
|
||||||
return null;
|
return null;
|
||||||
|
30
external/cecil/Mono.Cecil/ModuleDefinition.cs
vendored
30
external/cecil/Mono.Cecil/ModuleDefinition.cs
vendored
@ -418,13 +418,11 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
public IAssemblyResolver AssemblyResolver {
|
public IAssemblyResolver AssemblyResolver {
|
||||||
get {
|
get {
|
||||||
#if !NET_CORE
|
|
||||||
if (assembly_resolver.value == null) {
|
if (assembly_resolver.value == null) {
|
||||||
lock (module_lock) {
|
lock (module_lock) {
|
||||||
assembly_resolver = Disposable.Owned (new DefaultAssemblyResolver () as IAssemblyResolver);
|
assembly_resolver = Disposable.Owned (new DefaultAssemblyResolver () as IAssemblyResolver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return assembly_resolver.value;
|
return assembly_resolver.value;
|
||||||
}
|
}
|
||||||
@ -754,28 +752,16 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
internal FieldDefinition Resolve (FieldReference field)
|
internal FieldDefinition Resolve (FieldReference field)
|
||||||
{
|
{
|
||||||
#if NET_CORE
|
|
||||||
if (MetadataResolver == null)
|
|
||||||
throw new NotSupportedException ();
|
|
||||||
#endif
|
|
||||||
return MetadataResolver.Resolve (field);
|
return MetadataResolver.Resolve (field);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal MethodDefinition Resolve (MethodReference method)
|
internal MethodDefinition Resolve (MethodReference method)
|
||||||
{
|
{
|
||||||
#if NET_CORE
|
|
||||||
if (MetadataResolver == null)
|
|
||||||
throw new NotSupportedException ();
|
|
||||||
#endif
|
|
||||||
return MetadataResolver.Resolve (method);
|
return MetadataResolver.Resolve (method);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal TypeDefinition Resolve (TypeReference type)
|
internal TypeDefinition Resolve (TypeReference type)
|
||||||
{
|
{
|
||||||
#if NET_CORE
|
|
||||||
if (MetadataResolver == null)
|
|
||||||
throw new NotSupportedException ();
|
|
||||||
#endif
|
|
||||||
return MetadataResolver.Resolve (type);
|
return MetadataResolver.Resolve (type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -970,6 +956,19 @@ namespace Mono.Cecil {
|
|||||||
get { return module_lock; }
|
get { return module_lock; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void Read<TItem> (TItem item, Action<TItem, MetadataReader> read)
|
||||||
|
{
|
||||||
|
lock (module_lock) {
|
||||||
|
var position = reader.position;
|
||||||
|
var context = reader.context;
|
||||||
|
|
||||||
|
read (item, reader);
|
||||||
|
|
||||||
|
reader.position = position;
|
||||||
|
reader.context = context;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal TRet Read<TItem, TRet> (TItem item, Func<TItem, MetadataReader, TRet> read)
|
internal TRet Read<TItem, TRet> (TItem item, Func<TItem, MetadataReader, TRet> read)
|
||||||
{
|
{
|
||||||
lock (module_lock) {
|
lock (module_lock) {
|
||||||
@ -1321,6 +1320,9 @@ namespace Mono.Cecil {
|
|||||||
|
|
||||||
public static TargetRuntime ParseRuntime (this string self)
|
public static TargetRuntime ParseRuntime (this string self)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty (self))
|
||||||
|
return TargetRuntime.Net_4_0;
|
||||||
|
|
||||||
switch (self [1]) {
|
switch (self [1]) {
|
||||||
case '1':
|
case '1':
|
||||||
return self [3] == '0'
|
return self [3] == '0'
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user