diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-12-14 19:34:06 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-12-14 19:34:06 +0300 |
commit | 76ffcdabae660e9586273c9b40db180a0dc8d4c8 (patch) | |
tree | 1a0b35f500240bd4ee56051bd5513a41b91993fe /Mono.Cecil.Cil/Symbols.cs | |
parent | eea46c1a1357010bdc10adbd9d9b49106aa1f4c8 (diff) | |
parent | 1afa0668b38603cdb7197653d73194df749c2d0d (diff) |
Merge commit '1afa0668b38603cdb7197653d73194df749c2d0d' into mono-2017-10mono-2017-10
Diffstat (limited to 'Mono.Cecil.Cil/Symbols.cs')
-rw-r--r-- | Mono.Cecil.Cil/Symbols.cs | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/Mono.Cecil.Cil/Symbols.cs b/Mono.Cecil.Cil/Symbols.cs index b0ada58..4c4a8b0 100644 --- a/Mono.Cecil.Cil/Symbols.cs +++ b/Mono.Cecil.Cil/Symbols.cs @@ -479,7 +479,7 @@ namespace Mono.Cecil.Cil { internal InstructionOffset catch_handler; internal Collection<InstructionOffset> yields; internal Collection<InstructionOffset> resumes; - internal MethodDefinition move_next; + internal Collection<MethodDefinition> resume_methods; public InstructionOffset CatchHandler { get { return catch_handler; } @@ -494,9 +494,8 @@ namespace Mono.Cecil.Cil { get { return resumes ?? (resumes = new Collection<InstructionOffset> ()); } } - public MethodDefinition MoveNextMethod { - get { return move_next; } - set { move_next = value; } + public Collection<MethodDefinition> ResumeMethods { + get { return resume_methods ?? (resume_methods = new Collection<MethodDefinition> ()); } } 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 end; @@ -539,27 +538,39 @@ namespace Mono.Cecil.Cil { set { end = value; } } - public override CustomDebugInformationKind Kind { - get { return CustomDebugInformationKind.StateMachineScope; } - } - - public static Guid KindIdentifier = new Guid ("{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}"); - - internal StateMachineScopeDebugInformation (int start, int end) - : base (KindIdentifier) + internal StateMachineScope (int start, int end) { this.start = new InstructionOffset (start); this.end = new InstructionOffset (end); } - public StateMachineScopeDebugInformation (Instruction start, Instruction end) - : base (KindIdentifier) + 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 { + get { return CustomDebugInformationKind.StateMachineScope; } + } + + public static Guid KindIdentifier = new Guid ("{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}"); + + public StateMachineScopeDebugInformation () + : base (KindIdentifier) + { + } + } + public sealed class EmbeddedSourceDebugInformation : CustomDebugInformation { internal byte [] content; @@ -671,8 +682,10 @@ namespace Mono.Cecil.Cil { var offset_mapping = new Dictionary<int, SequencePoint> (sequence_points.Count); - for (int i = 0; i < sequence_points.Count; i++) - offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]); + for (int i = 0; i < sequence_points.Count; i++) { + if (!offset_mapping.ContainsKey (sequence_points [i].Offset)) + offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]); + } var instructions = method.Body.Instructions; |