PERWAPI.MetaDataOut.GetDebugSig C# (CSharp) Method

GetDebugSig() private method

Get the debug signature for a local.
private GetDebugSig ( Local loc ) : DebugLocalSig
loc Local The local.
return DebugLocalSig
        internal DebugLocalSig GetDebugSig(Local loc)
        {
            byte[] b = loc.GetSig();
            string s = BitConverter.ToString(b);
            DebugLocalSig sig = (DebugLocalSig)debugsigs[s];
            if (sig != null) return sig;
            sig = new DebugLocalSig(b);
            debugsigs.Add(s, sig);
            return sig;
        }

Usage Example

Example #1
0
        internal void BuildSignatures(MetaDataOut md)
        {
            if (!md.Debug) return;

             try {
               Local[] locals = _thisMeth.GetLocals();
               foreach (LocalBinding binding in _localBindings) {
             if (binding._debugsig == null) {
            locals[binding._index].BuildTables(md);
            binding._debugsig = md.GetDebugSig(locals[binding._index]);
             }
             binding._debugsig.BuildMDTables(md);
               }
             } catch (Exception e) {
               throw new Exception("Exception while writing debug info for: " +
                            this._thisMeth.NameString()+"\r\n"+e.ToString());
             }
        }