Пример #1
0
        public void UnwindCodeConstructorWorks_Test()
        {
            var unwindCode = new UnwindCode(new BufferFile(RawStructures.RawUnwindCode), 2);

            Assert.Equal((byte)0x11, unwindCode.CodeOffset);
            Assert.Equal(UnwindOpType.AllocSmall, unwindCode.UnwindOp);
            Assert.Equal((byte)0x3, unwindCode.Opinfo);
            Assert.Equal((ushort)0x5544, unwindCode.FrameOffset);
        }
Пример #2
0
        private static void DecorateUnwindInfo(ITextOutput output, Dictionary <ulong, UnwindCode> unwindInfo, ulong baseInstrIP, Instruction instr)
        {
            ulong nextInstructionOffset = instr.NextIP - baseInstrIP;

            if (unwindInfo != null && unwindInfo.ContainsKey(nextInstructionOffset))
            {
                UnwindCode unwindCode = unwindInfo[nextInstructionOffset];
                output.Write($" ; {unwindCode.UnwindOp}({unwindCode.OpInfoStr})");
            }
        }