예제 #1
0
        public uint GetILnanoCLRFromILCLR(uint ilCLR)
        {
            //Special case for when CPDE wants to step to the end of the function?
            if (ilCLR == uint.MaxValue)
            {
                return(uint.MaxValue);
            }

            uint ilnanoCLR = ILComparer.Map(true, m_pdbxMethod.ILMap, ilCLR);

            Debug.Assert(ilnanoCLR <= ilCLR);

            return(ilnanoCLR);
        }
예제 #2
0
        public uint GetILCLRFromILnanoCLR(uint ilnanoCLR)
        {
            uint ilCLR;

            //Special case for CatchHandlerFound and AppDomain transitions; possibly used elsewhere.
            if (ilnanoCLR == uint.MaxValue)
            {
                return(uint.MaxValue);
            }

            ilCLR = ILComparer.Map(false, m_pdbxMethod.ILMap, ilnanoCLR);
            Debug.Assert(ilnanoCLR <= ilCLR);

            return(ilCLR);
        }
예제 #3
0
            public static uint Map(bool fCLR, Pdbx.IL [] ilMap, uint offset)
            {
                ILComparer ilComparer = new ILComparer(fCLR);

                Pdbx.IL il = new Pdbx.IL();
                ilComparer.SetIL(il, offset);
                int  i   = Array.BinarySearch(ilMap, il, ilComparer);
                uint ret = 0;

                if (i >= 0)
                {
                    //Exact match
                    ret = GetIL(!fCLR, ilMap[i]);
                }
                else
                {
                    i = ~i;

                    if (i == 0)
                    {
                        //Before the IL diverges
                        ret = offset;
                    }
                    else
                    {
                        //Somewhere in between
                        i--;

                        il  = ilMap[i];
                        ret = offset - GetIL(fCLR, il) + GetIL(!fCLR, il);
                    }
                }

                Debug.Assert(ret >= 0);
                return(ret);
            }
            public static uint Map(bool fCLR, Pdbx.IL [] ilMap, uint offset)
            {
                ILComparer ilComparer = new ILComparer(fCLR);
                Pdbx.IL il = new Pdbx.IL();
                ilComparer.SetIL(il, offset);
                int i = Array.BinarySearch(ilMap, il, ilComparer);
                uint ret = 0;

                if (i >= 0)
                {
                    //Exact match
                    ret = GetIL(!fCLR, ilMap[i]);
                }
                else
                {

                    i = ~i;

                    if (i == 0)
                    {
                        //Before the IL diverges
                        ret = offset;
                    }
                    else
                    {
                        //Somewhere in between
                        i--;

                        il = ilMap[i];
                        ret = offset - GetIL(fCLR, il) + GetIL(!fCLR, il);
                    }
                }

                Debug.Assert(ret >= 0);
                return ret;
            }