using System.Collections;
using System.Diagnostics.SymbolStore;
using System.Runtime.InteropServices;
-using Mono.CSharp.Debugger;
namespace System.Reflection.Emit {
handlers [i].extype = null;
}
+ internal void AddFault (int offset)
+ {
+ int i;
+ End (offset);
+ add_block (offset);
+ i = handlers.Length - 1;
+ handlers [i].type = ILExceptionBlock.FAULT;
+ handlers [i].start = offset;
+ handlers [i].extype = null;
+ }
+
internal void End (int offset)
{
if (handlers == null)
private LabelFixup[] fixups;
private int num_fixups;
internal Module module;
- internal IMonoSymbolWriter sym_writer;
private Stack scopes;
private int cur_block;
private Stack open_blocks;
token_fixups = new ILTokenInfo [8];
num_token_fixups = 0;
module = m;
- if (module is ModuleBuilder)
- sym_writer = ((ModuleBuilder)module).symbol_writer;
open_blocks = new Stack ();
this.token_gen = token_gen;
}
if (open_blocks.Count <= 0)
throw new NotSupportedException ("Not in an exception block");
//System.Console.WriteLine ("Begin fault Block");
- //throw new NotImplementedException ();
+ ex_handlers [cur_block].AddFault (code_len);
}
public virtual void BeginFinallyBlock()
}
public virtual void BeginScope ()
- {
- if (sym_writer != null) {
- if (scopes == null)
- scopes = new Stack ();
- scopes.Push (sym_writer.OpenScope (code_len));
- }
- }
+ { }
public LocalBuilder DeclareLocal (Type localType)
+ {
+ return DeclareLocal (localType, false);
+ }
+
+
+#if NET_2_0
+ public
+#else
+ internal
+#endif
+ LocalBuilder DeclareLocal (Type localType, bool pinned)
{
LocalBuilder res = new LocalBuilder (localType, this);
+ res.is_pinned = pinned;
+
if (locals != null) {
LocalBuilder[] new_l = new LocalBuilder [locals.Length + 1];
System.Array.Copy (locals, new_l, locals.Length);
}
public virtual void EndScope ()
- {
- if (sym_writer != null) {
- sym_writer.CloseScope (code_len);
- if (scopes == null)
- throw new InvalidOperationException ();
- scopes.Pop ();
- }
- }
+ { }
public virtual void MarkLabel (Label loc)
{
public virtual void MarkSequencePoint (ISymbolDocumentWriter document, int startLine,
int startColumn, int endLine, int endColumn)
- {
- if (sym_writer == null)
- return;
-
- sym_writer.MarkSequencePoint (code_len, startLine, startColumn);
- }
+ { }
public virtual void ThrowException (Type exceptionType)
{
}
}
}
+
+ internal static int Mono_GetCurrentOffset (ILGenerator ig)
+ {
+ return ig.code_len;
+ }
}
}