src/sys/dotnet/perwapi/PERWAPI.cs
/// <summary>
/// Makes the assembly debuggable by attaching the DebuggableAttribute
/// to the Assembly. Call immediately before calling WritePEFile.
/// </summary>
/// <param name="allowDebug">set true to enable debugging, false otherwise</param>
/// <param name="suppressOpt">set true to disable optimizations that affect debugging</param>
Makes the assembly debuggable by attaching the DebuggableAttribute
to the Assembly. Call immediately before calling WritePEFile.
Makes the assembly debuggable by attaching the DebuggableAttribute to the Assembly . Call immediately before calling WritePEFile .
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);
        }
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 ( " " , " " ) ; if ( debugRef == null ) debugRef = MSCorLib . mscorlib . AddClass ( " " , " " ) ; dCtor = debugRef . GetMethod ( " " , twoBools ) ; if ( dCtor == null ) { dCtor = debugRef . AddMethod ( " " , PrimitiveType . Void , twoBools ) ; dCtor . AddCallConv ( CallConv . Instance ) ; } Constant [ ] dbgArgs = new Constant [ ] { new BoolConst ( allowDebug ) , new BoolConst ( suppressOpt ) } ; thisAssembly . AddCustomAttribute ( dCtor , dbgArgs ) ; }
Makes the assembly debuggable by attaching the DebuggableAttribute
to the Assembly.
Makes the assembly debuggable by attaching the DebuggableAttribute to the Assembly .
allowDebug
bool
set true to enable debugging, false otherwise
set true to enable debugging false otherwise
suppressOpt
bool
set true to disable optimizations that affect debugging
set true to disable optimizations that affect debugging