static DbgLoadModuleOptions ToDbgLoadModuleOptions(DbgLoadModuleReferenceHandlerOptions options)
        {
            var res = DbgLoadModuleOptions.None;

            if ((options & DbgLoadModuleReferenceHandlerOptions.AutoLoaded) != 0)
            {
                res |= DbgLoadModuleOptions.AutoLoaded;
            }
            if ((options & DbgLoadModuleReferenceHandlerOptions.ForceMemory) != 0)
            {
                res |= DbgLoadModuleOptions.ForceMemory;
            }
            return(res);
        }
        public override DbgModule[] Load(DbgModule[] modules, DbgLoadModuleReferenceHandlerOptions options)
        {
            var  loaded            = new List <DbgModule>();
            bool canShowMessageBox = true;

            foreach (var module in modules)
            {
                if (!module.IsDotNetModule())
                {
                    continue;
                }
                LoadModule(module, ToDbgLoadModuleOptions(options), ref canShowMessageBox);
                loaded.Add(module);
            }
            return(loaded.ToArray());
        }
        void IModuleLoader.LoadModules(DbgModule[] modules, DbgLoadModuleReferenceHandlerOptions options)
        {
            uiDispatcher.VerifyAccess();
            if (modules == null)
            {
                throw new ArgumentNullException(nameof(modules));
            }
            var hash = new HashSet <DbgModule>(modules);

            foreach (var lz in dbgLoadModuleReferenceHandlers)
            {
                if (hash.Count == 0)
                {
                    break;
                }
                var loaded = lz.Value.Load(hash.ToArray(), options);
                foreach (var module in loaded)
                {
                    hash.Remove(module);
                }
            }
            Debug.Assert(hash.Count == 0);
        }
Exemple #4
0
 /// <summary>
 /// Loads modules in the treeview. Returns an array of modules that got loaded.
 /// </summary>
 /// <param name="modules">Modules to load. Unsupported modules can be ignored.</param>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public abstract DbgModule[] Load(DbgModule[] modules, DbgLoadModuleReferenceHandlerOptions options);