public void MakeDebuggable(bool allowDebug, bool suppressOpt)
{
ClassRef debugRef = null;
MethodRef dCtor = null;
Type[] twoBools = new Type[] { PrimitiveType.Boolean, PrimitiveType.Boolean };
debugRef = MSCorLib.mscorlib.GetClass("System.Diagnostics", "DebuggableAttribute");
if (debugRef == null)
debugRef = MSCorLib.mscorlib.AddClass("System.Diagnostics", "DebuggableAttribute");
dCtor = debugRef.GetMethod(".ctor", twoBools);
if (dCtor == null)
{
dCtor = debugRef.AddMethod(".ctor", PrimitiveType.Void, twoBools);
dCtor.AddCallConv(CallConv.Instance);
}
Constant[] dbgArgs = new Constant[] { new BoolConst(allowDebug), new BoolConst(suppressOpt) };
thisAssembly.AddCustomAttribute(dCtor, dbgArgs);
}