Example #1
0
        public string GetSlotState(GcSlotTable slotTable, Machine machine)
        {
            GcSlotTable.GcSlot slot    = slotTable.GcSlots[SlotId];
            string             slotStr = "";

            if (slot.StackSlot == null)
            {
                Type regType = typeof(Amd64.Registers);
                if (machine == Machine.ArmThumb2)
                {
                    regType = typeof(Arm.Registers);
                }
                else
                {
                    regType = typeof(Arm64.Registers);
                }
                slotStr = Enum.GetName(regType, slot.RegisterNumber);
            }
            else
            {
                slotStr = $"sp{slot.StackSlot.SpOffset:+#;-#;+0}";
            }
            string isLiveStr = "live";

            if (!IsLive)
            {
                isLiveStr = "dead";
            }
            return($"{slotStr} is {isLiveStr}");
        }
Example #2
0
        public string GetSlotState(GcSlotTable slotTable)
        {
            GcSlotTable.GcSlot slot    = slotTable.GcSlots[SlotId];
            string             slotStr = "";

            if (slot.StackSlot == null)
            {
                slotStr = Enum.GetName(typeof(Registers), slot.RegisterNumber);
            }
            else
            {
                slotStr = $"sp{slot.StackSlot.SpOffset:+#;-#;+0}";
            }
            string isLiveStr = "live";

            if (!IsLive)
            {
                isLiveStr = "dead";
            }
            return($"{slotStr} is {isLiveStr}");
        }
Example #3
0
        public string GetSlotState(GcSlotTable slotTable, Machine machine)
        {
            GcSlotTable.GcSlot slot    = slotTable.GcSlots[SlotId];
            string             slotStr = "";

            if (slot.StackSlot == null)
            {
                Type regType;
                switch (machine)
                {
                case Machine.ArmThumb2:
                    regType = typeof(Arm.Registers);
                    break;

                case Machine.Arm64:
                    regType = typeof(Arm64.Registers);
                    break;

                case Machine.Amd64:
                    regType = typeof(Amd64.Registers);
                    break;

                default:
                    throw new NotImplementedException();
                }
                slotStr = Enum.GetName(regType, slot.RegisterNumber);
            }
            else
            {
                slotStr = $"sp{slot.StackSlot.SpOffset:+#;-#;+0}";
            }
            string isLiveStr = "live";

            if (!IsLive)
            {
                isLiveStr = "dead";
            }
            return($"{slotStr} is {isLiveStr}");
        }