bool UpdateAssemblyFilters(AssemblyMirror asm)
        {
            var name = asm.GetName().FullName;

            if (userAssemblyNames != null)
            {
                //HACK: not sure how else to handle xsp-compiled pages
                if (name.StartsWith("App_"))
                {
                    assemblyFilters.Add(asm);
                    return(true);
                }

                foreach (var n in userAssemblyNames)
                {
                    if (n == name)
                    {
                        assemblyFilters.Add(asm);
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #2
0
        public override TypeMirror?Load(AssemblyMirror assembly, string typeFullName)
        {
            var res = engine.CheckFuncEval(evalInfo.Context);

            if (!(res is null))
            {
                return(null);
            }
            var appDomain = evalInfo.Frame.AppDomain;

            if (appDomain is null)
            {
                return(null);
            }
            var state = appDomain.GetOrCreateData <LoaderState>();

            if (!state.LoadedTypes.Add(typeFullName))
            {
                return(null);
            }

            var reflectionAppDomain = appDomain.GetReflectionAppDomain() ?? throw new InvalidOperationException();
            var runtime             = engine.DotNetRuntime;

            DbgDotNetValue?      asmTypeValue = null;
            DbgDotNetValueResult result1      = default;
            DbgDotNetValueResult result2      = default;

            try {
                if (state.Method_System_Reflection_Assembly_GetType_String is null)
                {
                    var assemblyType = reflectionAppDomain.GetWellKnownType(DmdWellKnownType.System_Reflection_Assembly);
                    state.Method_System_Reflection_Assembly_GetType_String =
                        assemblyType.GetMethod(nameof(System.Reflection.Assembly.GetType), DmdSignatureCallingConvention.HasThis,
                                               0, reflectionAppDomain.System_Type, new[] { reflectionAppDomain.System_String }, throwOnError: false);
                    Debug.Assert(!(state.Method_System_Reflection_Assembly_GetType_String is null));
                    if (state.Method_System_Reflection_Assembly_GetType_String is null)
                    {
                        return(null);
                    }

                    state.Method_System_Array_CreateInstance_Type_Int32 =
                        reflectionAppDomain.System_Array.GetMethod(nameof(Array.CreateInstance), DmdSignatureCallingConvention.Default,
                                                                   0, reflectionAppDomain.System_Array, new[] { reflectionAppDomain.System_Type, reflectionAppDomain.System_Int32 }, throwOnError: false);
                    Debug.Assert(!(state.Method_System_Array_CreateInstance_Type_Int32 is null));
                    if (state.Method_System_Array_CreateInstance_Type_Int32 is null)
                    {
                        return(null);
                    }
                }

                if (state.Method_System_Reflection_Assembly_GetType_String is null || state.Method_System_Array_CreateInstance_Type_Int32 is null)
                {
                    return(null);
                }

                asmTypeValue = engine.CreateDotNetValue_MonoDebug(reflectionAppDomain, assembly.GetAssemblyObject(), null);
                result1      = runtime.Call(evalInfo, asmTypeValue, state.Method_System_Reflection_Assembly_GetType_String,
                                            new[] { typeFullName }, DbgDotNetInvokeOptions.None);
                if (result1.IsNormalResult)
                {
                    result2 = runtime.Call(evalInfo, null, state.Method_System_Array_CreateInstance_Type_Int32,
                                           new object[2] {
                        result1.Value !, 0
                    }, DbgDotNetInvokeOptions.None);
                    if (result2.IsNormalResult)
                    {
                        var arrayType = result2.Value !.Type;
                        Debug.Assert(arrayType.IsSZArray);
                        if (arrayType.IsSZArray)
                        {
                            return(MonoDebugTypeCreator.TryGetType(arrayType.GetElementType() !));
                        }
                    }
                }
Пример #3
0
 public abstract TypeMirror?Load(AssemblyMirror assembly, string typeFullName);
Пример #4
0
 public SdbAssemblyMirror(AssemblyMirror assemblyMirror) : base(assemblyMirror)
 {
 }
Пример #5
0
 // Token: 0x060000B7 RID: 183 RVA: 0x00003D10 File Offset: 0x00001F10
 public AD7Module(AssemblyMirror assembly, StartInfo startInfo)
 {
     this.assembly  = assembly;
     this.startInfo = startInfo;
 }
Пример #6
0
 public AD7Assembly(AD7Engine engine, AssemblyMirror assembly)
 {
     _engine        = engine;
     AssemblyMirror = assembly;
 }