Exemple #1
0
 public static DbgNamedTypeInfo GetNamedTypeInfo(DbgEngDebugger debugger,
                                                 DbgModuleInfo module,
                                                 uint typeId,
                                                 SymTag symTag)
 {
     return(_EnsureIsNamed(GetTypeInfo(debugger, module, typeId, symTag)));
 }
Exemple #2
0
        private static DbgTypeInfo _LoadTypeInfo(DbgEngDebugger debugger,
                                                 DbgModuleInfo module,
                                                 uint typeId,
                                                 SymTag symTag)
        {
            if (null == debugger)
            {
                throw new ArgumentNullException("debugger");
            }

            if (IsDbgGeneratedType(typeId) &&
                !DbgHelp.PeekSyntheticTypeExists(debugger.DebuggerInterface,
                                                 module.BaseAddress,
                                                 typeId))
            {
                return(new DbgGeneratedTypeInfo(debugger, module, typeId, symTag));
            }

            return(debugger.ExecuteOnDbgEngThread(() =>
            {
                if (((int)symTag) > sm_factories.Length)
                {
                    // In case they extend the SymTag enum and I don't get updated.
                    Util.Fail("Need to update SymTag enum.");
                    return _DefaultFactory(debugger, module, typeId, symTag);
                }

                return sm_factories[(int)symTag](debugger, module, typeId);
            }));
        } // end _LoadTypeInfo()
Exemple #3
0
        } // end GetChildrenIds()

        private static DbgTypeInfo _DefaultFactory(DbgEngDebugger debugger,
                                                   DbgModuleInfo module,
                                                   uint typeId,
                                                   SymTag symTag)
        {
            return(new DbgTypeInfo(debugger, module, typeId, symTag));
        }
Exemple #4
0
        } // end constructor

        protected DbgNamedTypeInfo(DbgEngDebugger debugger,
                                   ulong moduleBase,
                                   uint typeId,
                                   SymTag symTag,
                                   DbgTarget target)
            : this(debugger, moduleBase, typeId, symTag, null, null, target)
        {
        } // end constructor
Exemple #5
0
 protected DbgTypeInfo(DbgEngDebugger debugger,
                       DbgModuleInfo module,
                       uint typeId,
                       SymTag symTag)
     : this(debugger, GetModBase(module), typeId, symTag, module.Target)
 {
     __mod = module;
 } // end constructor
Exemple #6
0
 private DbgNamedTypeInfo(DbgEngDebugger debugger,
                          ulong moduleBase,
                          uint typeId,
                          SymTag symTag,
                          string name,
                          ulong?pSize,
                          DbgTarget target)
     : base(debugger, moduleBase, typeId, symTag, target)
 {
     m_name  = name;
     m_pSize = pSize;
 } // end constructor
Exemple #7
0
 public static DbgNamedTypeInfo GetNamedTypeInfo(DbgEngDebugger debugger,
                                                 ulong moduleBase,
                                                 uint typeId,
                                                 SymTag symTag,
                                                 DbgTarget target)
 {
     return(_EnsureIsNamed(GetTypeInfo(debugger,
                                       moduleBase,
                                       typeId,
                                       symTag,
                                       target)));
 }
Exemple #8
0
        } // end _LoadTypeInfo()

        public static DbgTypeInfo GetTypeInfo(DbgEngDebugger debugger,
                                              ulong moduleBase,
                                              uint typeId,
                                              SymTag symTag,
                                              DbgTarget target)
        {
            moduleBase = _AdjustModBase(moduleBase, typeId, target);
            return(GetTypeInfo(debugger,
                               new DbgModuleInfo(debugger, moduleBase, target),
                               typeId,
                               symTag));
        }
Exemple #9
0
        public static DbgTypeInfo GetTypeInfo(DbgEngDebugger debugger,
                                              DbgModuleInfo module,
                                              uint typeId,
                                              SymTag symTag)
        {
            DbgTypeInfo typeInfo;

            if (!_TryGetFromCache(module.BaseAddress, typeId, module.Target, out typeInfo))
            {
                typeInfo = _LoadTypeInfo(debugger, module, typeId, symTag);
                _AddToCache(typeInfo);
            }
            return(typeInfo);
        }
Exemple #10
0
        } // end constructor

        protected DbgNamedTypeInfo(DbgEngDebugger debugger,
                                   DbgModuleInfo module,
                                   uint typeId,
                                   SymTag symTag,
                                   ulong size)
            : this(debugger,
                   GetModBase(module),
                   typeId,
                   symTag,
                   null,
                   size,
                   module.Target)
        {
            __mod = module;
        } // end constructor
Exemple #11
0
        protected DbgTypeInfo(DbgEngDebugger debugger,
                              ulong moduleBase,
                              uint typeId,
                              SymTag symTag,
                              DbgTarget target)
            : base(debugger)
        {
            m_modBase = moduleBase;
            TypeId    = typeId;
            SymTag    = symTag;

            if (null == target)
            {
                throw new ArgumentNullException("target");
            }

            Target         = target;
            m_symbolCookie = Target.GetSymbolCookie(moduleBase);
        } // end constructor
Exemple #12
0
        public DbgGeneratedTypeInfo(DbgEngDebugger debugger,
                                    ulong moduleBase,
                                    uint typeId,
                                    SymTag symTag,
                                    DbgTarget target)
            : base(debugger, moduleBase, typeId, symTag, target)
        {
            if (!IsDbgGeneratedType(typeId))
            {
                throw new ArgumentException("The typeId does not look like a debugger-generated typeId to me.",
                                            "typeId");
            }

            //
            // TODO: Dbgeng internally stores info about generated types in a
            // DBG_GENERATED_TYPE structure. Unfortunately, there is no way to get at that
            // information, so until they provide an API, this class is just a dummy
            // placeholder.
            //
        } // end constructor