private static string getClassNameFromType(Type type) { if (type == null) { return("<Module>"); } if (ClassLoaderWrapper.IsRemappedType(type)) { return(DotNetTypeWrapper.GetName(type)); } TypeWrapper tw = ClassLoaderWrapper.GetWrapperFromType(type); if (tw != null) { if (tw.IsPrimitive) { return(DotNetTypeWrapper.GetName(type)); } #if !FIRST_PASS if (tw.IsUnsafeAnonymous) { return(tw.ClassObject.getName()); } #endif return(tw.Name); } return(type.FullName); }
private static string GetFileName(StackFrame frame) { MethodBase mb = frame.GetMethod(); if (mb != null && mb.DeclaringType != null) { if (ClassLoaderWrapper.IsRemappedType(mb.DeclaringType)) { return(null); } TypeWrapper tw = ClassLoaderWrapper.GetWrapperFromType(mb.DeclaringType); if (tw != null) { return(tw.GetSourceFileName()); } } return(null); }
private static string getClassNameFromType(Type type) { if (ClassLoaderWrapper.IsRemappedType(type)) { return(DotNetTypeWrapper.GetName(type)); } TypeWrapper tw = ClassLoaderWrapper.GetWrapperFromType(type); if (tw != null) { if (tw.IsPrimitive) { return(DotNetTypeWrapper.GetName(type)); } return(tw.Name); } return(type.FullName); }
private static int GetLineNumber(StackFrame frame) { int ilOffset = frame.GetILOffset(); if (ilOffset != StackFrame.OFFSET_UNKNOWN) { MethodBase mb = frame.GetMethod(); if (mb != null && mb.DeclaringType != null) { if (ClassLoaderWrapper.IsRemappedType(mb.DeclaringType)) { return(-1); } TypeWrapper tw = ClassLoaderWrapper.GetWrapperFromType(mb.DeclaringType); if (tw != null) { return(tw.GetSourceLineNumber(mb, ilOffset)); } } } return(-1); }