コード例 #1
0
        // Example:
        //
        //    0:009> r
        //     r0=00000000  r1=00000000  r2=00000000  r3=76fdcf09  r4=00000000  r5=028df6e0
        //     r6=028df730  r7=00000000  r8=00000001  r9=01507858 r10=015156a8 r11=028df8e8
        //    r12=00000000  sp=028df6c8  lr=00000000  pc=76ccce24 psr=600f0030 -ZC-- Thumb
        //    KERNELBASE!RaiseFailFastException+0x60:
        //    76ccce24 f000f846 bl          KERNELBASE!SignalStartWerSvc (76ccceb4)
        //
        public override ColorString ToColorString()
        {
            if (null == m_colorString)
            {
                ConsoleColor color;
                ColorString  cs = new ColorString(" r0=");
                color = GetColorForDiffAgainstBaseline("r0");
                cs.Append(R0.GetColorizedValueString(color));
                cs.Append("  r1=");
                color = GetColorForDiffAgainstBaseline("r1");
                cs.Append(R1.GetColorizedValueString(color));
                cs.Append("  r2=");
                color = GetColorForDiffAgainstBaseline("r2");
                cs.Append(R2.GetColorizedValueString(color));
                cs.Append("  r3=");
                color = GetColorForDiffAgainstBaseline("r3");
                cs.Append(R3.GetColorizedValueString(color));
                cs.Append("  r4=");
                color = GetColorForDiffAgainstBaseline("r4");
                cs.Append(R4.GetColorizedValueString(color));
                cs.Append("  r5=");
                color = GetColorForDiffAgainstBaseline("r5");
                cs.Append(R5.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append(" r6=");
                color = GetColorForDiffAgainstBaseline("r6");
                cs.Append(R6.GetColorizedValueString(color));
                cs.Append("  r7=");
                color = GetColorForDiffAgainstBaseline("r7");
                cs.Append(R7.GetColorizedValueString(color));
                cs.Append("  r8=");
                color = GetColorForDiffAgainstBaseline("r8");
                cs.Append(R8.GetColorizedValueString(color));
                cs.Append("  r9=");
                color = GetColorForDiffAgainstBaseline("r9");
                cs.Append(R9.GetColorizedValueString(color));
                cs.Append(" r10=");
                color = GetColorForDiffAgainstBaseline("r10");
                cs.Append(R10.GetColorizedValueString(color));
                cs.Append(" r11=");
                color = GetColorForDiffAgainstBaseline("r11");
                cs.Append(R11.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("r12=");
                color = GetColorForDiffAgainstBaseline("r12");
                cs.Append(R12.GetColorizedValueString(color));
                cs.Append("  sp=");
                color = GetColorForDiffAgainstBaseline("sp");
                cs.Append(Sp.GetColorizedValueString(color));
                cs.Append("  lr=");
                color = GetColorForDiffAgainstBaseline("lr");
                cs.Append(Lr.GetColorizedValueString(color));
                cs.Append("  pc=");
                color = GetColorForDiffAgainstBaseline("pc");
                cs.Append(Pc.GetColorizedValueString(color));
                cs.Append(" psr=");
                color = GetColorForDiffAgainstBaseline("psr");
                cs.Append(Psr.GetColorizedValueString(color));

                // TODO:
                cs.AppendLine(" TBD: flags and mode");

                cs.Append(DbgProvider.ColorizeSymbol(StackFrame.SymbolName));
                if (0 != StackFrame.Displacement)
                {
                    cs.Append("+0x");
                    cs.Append(StackFrame.Displacement.ToString("x"));
                }
                cs.AppendLine(":");
                cs.Append(Disasm(Pc.ValueAsPointer));

                m_colorString = cs;
            }
            return(m_colorString);
        } // end ToString()
コード例 #2
0
        // Example:
        //
        // rax=000007f7d5e4e000 rbx=0000000000000000 rcx=0000000000000000
        // rdx=000007fcac628f98 rsi=0000000000000000 rdi=0000000000000000
        // rip=000007fcac571e00 rsp=0000000b9879fb78 rbp=0000000000000000
        //  r8=0000000000000000  r9=000007fcac628f98 r10=0000000000000000
        // r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
        // r14=0000000000000000 r15=0000000000000000
        // iopl=0         nv up ei pl zr na po nc
        // cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
        //   ntdll!DbgBreakPoint:
        //
        public override ColorString ToColorString()
        {
            if (null == m_colorString)
            {
                ConsoleColor color;
                ColorString  cs = new ColorString("rax=");
                color = GetColorForDiffAgainstBaseline("rax");
                cs.Append(Rax.GetColorizedValueString(color));
                cs.Append(" rbx=");
                color = GetColorForDiffAgainstBaseline("rbx");
                cs.Append(Rbx.GetColorizedValueString(color));
                cs.Append(" rcx=");
                color = GetColorForDiffAgainstBaseline("rcx");
                cs.Append(Rcx.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("rdx=");
                color = GetColorForDiffAgainstBaseline("rdx");
                cs.Append(Rdx.GetColorizedValueString(color));
                cs.Append(" rsi=");
                color = GetColorForDiffAgainstBaseline("rsi");
                cs.Append(Rsi.GetColorizedValueString(color));
                cs.Append(" rdi=");
                color = GetColorForDiffAgainstBaseline("rdi");
                cs.Append(Rdi.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("rip=");
                color = GetColorForDiffAgainstBaseline("rip");
                cs.Append(Rip.GetColorizedValueString(color));
                cs.Append(" rsp=");
                color = GetColorForDiffAgainstBaseline("rsp");
                cs.Append(Rsp.GetColorizedValueString(color));
                cs.Append(" rbp=");
                color = GetColorForDiffAgainstBaseline("rbp");
                cs.Append(Rbp.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append(" r8=");
                color = GetColorForDiffAgainstBaseline("r8");
                cs.Append(R8.GetColorizedValueString(color));
                cs.Append("  r9=");
                color = GetColorForDiffAgainstBaseline("r9");
                cs.Append(R9.GetColorizedValueString(color));
                cs.Append(" r10=");
                color = GetColorForDiffAgainstBaseline("r10");
                cs.Append(R10.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("r11=");
                color = GetColorForDiffAgainstBaseline("r11");
                cs.Append(R11.GetColorizedValueString(color));
                cs.Append(" r12=");
                color = GetColorForDiffAgainstBaseline("r12");
                cs.Append(R12.GetColorizedValueString(color));
                cs.Append(" r13=");
                color = GetColorForDiffAgainstBaseline("r13");
                cs.Append(R13.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("r14=");
                color = GetColorForDiffAgainstBaseline("r14");
                cs.Append(R14.GetColorizedValueString(color));
                cs.Append(" r15=");
                color = GetColorForDiffAgainstBaseline("r15");
                cs.Append(R15.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("iopl=");
                color = GetColorForDiffAgainstBaseline("iopl");
                cs.AppendPushPopFg(color, ((ulong)Iopl.Value).ToString("x"));
                // TODO:
                cs.AppendLine("   TBD: flags");

                cs.Append("cs=");
                color = GetColorForDiffAgainstBaseline("cs");
                cs.AppendPushPopFg(color, ((ushort)Cs.Value).ToString("x4"));
                cs.Append("  ss=");
                color = GetColorForDiffAgainstBaseline("ss");
                cs.AppendPushPopFg(color, ((ushort)Ss.Value).ToString("x4"));
                cs.Append("  ds=");
                color = GetColorForDiffAgainstBaseline("ds");
                cs.AppendPushPopFg(color, ((ushort)Ds.Value).ToString("x4"));
                cs.Append("  es=");
                color = GetColorForDiffAgainstBaseline("es");
                cs.AppendPushPopFg(color, ((ushort)Es.Value).ToString("x4"));
                cs.Append("  fs=");
                color = GetColorForDiffAgainstBaseline("fs");
                cs.AppendPushPopFg(color, ((ushort)Fs.Value).ToString("x4"));
                cs.Append("  gs=");
                color = GetColorForDiffAgainstBaseline("gs");
                cs.AppendPushPopFg(color, ((ushort)Gs.Value).ToString("x4"));
                cs.Append("             efl=");
                color = GetColorForDiffAgainstBaseline("efl");
                cs.Append(Efl.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append(DbgProvider.ColorizeSymbol(StackFrame.SymbolName));
                if (0 != StackFrame.Displacement)
                {
                    cs.Append("+0x");
                    cs.Append(StackFrame.Displacement.ToString("x"));
                }
                cs.AppendLine(":");
                cs.Append(Disasm(Rip.ValueAsPointer));

                m_colorString = cs;
            }
            return(m_colorString);
        } // end ToString()