Esempio n. 1
0
        internal MondDebugContext(
            MondState state, MondProgram program, int address,
            Frame locals, Frame args,
            ReturnAddress[] callStack,  int callStackTop, int callStackBottom)
        {
            _state = state;
            _address = address;
            _locals = locals;
            _args = args;

            Program = program;
            DebugInfo = program.DebugInfo;

            CallStack = GenerateCallStack(address, callStack, callStackTop, callStackBottom).AsReadOnly();

            _localObject = CreateLocalObject();
        }
Esempio n. 2
0
 private void PushCall(ReturnAddress value)
 {
     _callStack[_callStackSize++] = value;
 }
Esempio n. 3
0
        private List<CallStackEntry> GenerateCallStack(int address, ReturnAddress[] callStack, int callStackTop, int callStackBottom)
        {
            var result = new List<CallStackEntry>();

            // current location
            result.Add(GenerateCallStackEntry(Program, address));

            // previous locations
            for (var i = callStackTop - 1; i >= 0; i--)
            {
                if (i == callStackBottom)
                {
                    if (callStackBottom > 0)
                        result.Add(new CallStackEntry(0, "[... native ...]", null, 0, -1));

                    continue;
                }

                var returnAddress = callStack[i];
                result.Add(GenerateCallStackEntry(returnAddress.Program, returnAddress.Address));
            }

            return result;
        }
Esempio n. 4
0
 private void PushCall(ReturnAddress value)
 {
     _callStack[_callStackSize++] = value;
 }