Imported Upstream version 5.8.0.88

Former-commit-id: 4b7216ffda08448e562271ce733688e761120fc5
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-11-28 19:36:51 +00:00
parent 7d05485754
commit 6123a772ed
277 changed files with 4817 additions and 941 deletions

View File

@@ -111,10 +111,10 @@ namespace Mono.Cecil.Pdb {
}
if (info.HasCustomDebugInformations) {
var scopes = info.CustomDebugInformations.OfType<StateMachineScopeDebugInformation> ().ToArray ();
var state_machine = info.CustomDebugInformations.FirstOrDefault (cdi => cdi.Kind == CustomDebugInformationKind.StateMachineScope) as StateMachineScopeDebugInformation;
if (scopes.Length > 0)
metadata.WriteIteratorScopes (scopes, info);
if (state_machine != null)
metadata.WriteIteratorScopes (state_machine, info);
}
metadata.WriteCustomMetadata ();
@@ -139,7 +139,7 @@ namespace Mono.Cecil.Pdb {
async_metadata.WriteUInt32 ((uint) async_debug_info.Resumes.Count);
for (int i = 0; i < async_debug_info.Resumes.Count; ++i) {
async_metadata.WriteUInt32 ((uint) async_debug_info.Yields [i].Offset);
async_metadata.WriteUInt32 (async_debug_info.MoveNextMethod != null ? async_debug_info.MoveNextMethod.MetadataToken.ToUInt32 () : 0);
async_metadata.WriteUInt32 (async_debug_info.resume_methods [i].MetadataToken.ToUInt32 ());
async_metadata.WriteUInt32 ((uint) async_debug_info.Resumes [i].Offset);
}
@@ -312,10 +312,11 @@ namespace Mono.Cecil.Pdb {
Write (CustomMetadataType.ForwardInfo, () => writer.WriteUInt32 (import_parent.ToUInt32 ()));
}
public void WriteIteratorScopes (StateMachineScopeDebugInformation [] scopes, MethodDebugInformation debug_info)
public void WriteIteratorScopes (StateMachineScopeDebugInformation state_machine, MethodDebugInformation debug_info)
{
Write (CustomMetadataType.IteratorScopes, () => {
writer.WriteInt32 (scopes.Length);
var scopes = state_machine.Scopes;
writer.WriteInt32 (scopes.Count);
foreach (var scope in scopes) {
var start = scope.Start.Offset;
var end = scope.End.IsEndOfMethod ? debug_info.code_size : scope.End.Offset;