Beispiel #1
0
        public ColorString ToColorString()
        {
            // return DbgProvider.FormatAddress( BaseAddress,
            //                                   Debugger.TargetIs32Bit,
            //                                   true )
            //             .Append( " " )
            //             .Append( DbgProvider.FormatAddress( BaseAddress + Size,
            //                                                 Debugger.TargetIs32Bit,
            //                                                 true ) )
            //             .Append( " " )
            //             .AppendPushPopFgBg( ConsoleColor.Black,
            //                                 ConsoleColor.DarkYellow,
            //                                 Name )
            //             .Append( Name.Length < 20 ? new String( ' ', 20 - Name.Length ) : String.Empty )
            //             .Append( SymbolStatus );

            return(DbgProvider.ColorizeModuleName(Name)
                   .Append("  ")
                   .Append(DbgProvider.FormatAddress(BaseAddress, Debugger.TargetIs32Bit,
                                                     true))
                   .Append(" ")
                   .Append(DbgProvider.FormatAddress(BaseAddress + Size,
                                                     Debugger.TargetIs32Bit,
                                                     true)));
        } // end ToColorString()
Beispiel #2
0
        public override ColorString ToColorString()
        {
            var cs = new ColorString().Append(DbgProvider.ColorizeModuleName(m_sym.Module.Name))
                     .Append("!")
                     .Append(DbgProvider.ColorizeTypeName(m_sym.Name));

            return(cs);
        }
            public ColorString ToColorString()
            {
                if (null == m_cs)
                {
                    m_cs = new ColorString();
                    m_cs.Append(DbgProvider.ColorizeModuleName(m_udt.Module.Name))
                    .Append("!")
                    .Append(m_udt.ColorName)
                    .Append(" (size 0x")
                    .Append(m_udt.Size.ToString("x"))
                    .Append(")");

                    int widest = 16;
                    foreach (var item in Items)
                    {
                        var ddti = item.Item as DbgDataTypeInfo;
                        if (null != ddti)
                        {
                            widest = Math.Max(widest, ddti.Name.Length);
                        }
                    }

                    widest = Math.Min(widest, 40);

                    foreach (var item in Items)
                    {
                        m_cs.AppendLine()
                        .Append("   +0x")
                        .Append(item.Offset.ToString("x3"))
                        .Append(" ");

                        var ddti = item.Item as DbgDataTypeInfo;
                        if (null != ddti)
                        {
                            m_cs.Append(ColorString.MakeFixedWidth(ddti.Name, widest))
                            .Append(" : ")
                            .Append(ddti.DataType.ColorName);
                        }
                        else
                        {
                            VTableLayoutItem vli = (VTableLayoutItem)item;
                            var dvti             = (DbgVTableTypeInfo)item.Item;
                            m_cs.AppendPushFg(ConsoleColor.DarkGray);

                            if (vli.VTablePath.Count > 1)
                            {
                                m_cs.Append(vli.VTablePath[1].ColorName).Append(": ");
                            }
                            m_cs.Append(dvti.ToColorString())
                            .AppendPop();
                        }
                    }

                    m_cs.MakeReadOnly();
                } // end if( !m_cs )
                return(m_cs);
            }     // end ToColorString()
        public override ColorString ToColorString()
        {
            // TODO: This is the same as the DbgNativeFunction... factor out?
            // Or factor Module "in"? (Because maybe not all functions would have a
            // module?)
            var cs = new ColorString().Append(DbgProvider.ColorizeModuleName(Module.Name))
                     .Append("!")
                     .Append(DbgProvider.ColorizeTypeName(Name));

            return(cs);
        }
Beispiel #5
0
        } // end Module


        public override ColorString ToColorString()
        {
            ColorString cs = new ColorString();

            if (null != Module)
            {
                cs.Append(DbgProvider.ColorizeModuleName(Module.Name)).Append("!");
            }
            cs.Append(DbgProvider.ColorizeTypeName(Name));
            return(cs);
        }
Beispiel #6
0
        private static ColorString _SummarizeModuleList(bool loadedMods, List <object> modObjList, int maxWidth)
        {
            ColorString cs = new ColorString();

            if (0 == modObjList.Count)
            {
                cs.AppendPushPopFg(ConsoleColor.DarkGray, "(0 modules)");
            }
            else
            {
                cs.Append(Util.Sprintf("{0} modules: ", modObjList.Count));

                for (int i = 0; i < Math.Min(modObjList.Count, 3); i++)
                {
                    if (i > 0)
                    {
                        cs.Append(", ");
                    }

                    DbgModuleInfo dmi = (DbgModuleInfo)modObjList[i];
                    if (loadedMods)
                    {
                        cs.Append(DbgProvider.ColorizeModuleName(dmi.Name));
                    }
                    else
                    {
                        cs.Append(dmi.ImageName);
                    }
                }

                if (modObjList.Count > 3)
                {
                    cs.Append(", ...");
                }
            }

            return(CaStringUtil.Truncate(cs.ToString(DbgProvider.HostSupportsColor), maxWidth));
        } // end _SummarizeModuleList()