Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Mono.Cecil.Cil/Symbols.cs')
-rw-r--r--Mono.Cecil.Cil/Symbols.cs47
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;