Exemplo n.º 1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            WriteObject(DbgHelp.SymGetTypeInfo(Debugger.DebuggerInterface,
                                               ModBase,
                                               TypeId,
                                               //IMAGEHLP_SYMBOL_TYPE_INFO.TI_GET_SYMINDEX ) );
                                               TypeInfo));
        } // end ProcessRecord()
Exemplo n.º 2
0
        internal override object GetConstantValue()
        {
            if (!IsConstant)
            {
                return(base.GetConstantValue()); // will throw
            }
            object rawVal = DbgHelp.SymGetTypeInfo(Debugger.DebuggerInterface,
                                                   Module.BaseAddress,
                                                   m_symInfo.Index,
                                                   IMAGEHLP_SYMBOL_TYPE_INFO.TI_GET_VALUE);

            // The raw value might be stored more efficiently than the actual type--for
            // instance, a DWORD constant might be stored (and returned from
            // SymGetTypeInfo) as a USHORT. So we might need to extend the value to get
            // fidelity with the true type of the constant.

            Debug.Assert((Type is DbgBaseTypeInfo) || (Type is DbgEnumTypeInfo));

            DbgBaseTypeInfo bti;

            bti = Type as DbgBaseTypeInfo;
            if (null == bti)
            {
                DbgEnumTypeInfo eti = Type as DbgEnumTypeInfo;
                if (null != eti)
                {
                    bti = eti.BaseType;
                }
                else
                {
                    throw new DbgProviderException(
                              Util.Sprintf("I don't know how to handle constants with Type: {0}",
                                           Util.GetGenericTypeName(Type)),
                              "DontKnowHowToHandleConstantType",
                              System.Management.Automation.ErrorCategory.NotImplemented);
                }
            }
            return(DbgHelp.ReconstituteConstant(rawVal, bti));
        }