Example #1
0
        public WabbitcodeDebugger(string outputFile)
        {
            _disposed = false;

            _debuggerService = DependencyFactory.Resolve <IDebuggerService>();
            _fileService     = DependencyFactory.Resolve <IFileService>();
            _symbolService   = DependencyFactory.Resolve <ISymbolService>();

            WabbitcodeBreakpointManager.OnBreakpointAdded   += WabbitcodeBreakpointManager_OnBreakpointAdded;
            WabbitcodeBreakpointManager.OnBreakpointRemoved += WabbitcodeBreakpointManager_OnBreakpointRemoved;

            Debug.WriteLine("Creating wabbitemu debugger");
            _debugger = new WabbitemuDebugger();
            Debug.WriteLine("Loading file " + outputFile);
            _debugger.LoadFile(outputFile);
            _debugger.Visible       = true;
            _debugger.OnBreakpoint += BreakpointHit;
            _debugger.OnClose      += DebuggerOnClose;

            CurrentDebuggingFile = outputFile;
            IsAnApp            = outputFile.EndsWith(".8xk");
            _memoryAllocations = new List <KeyValuePair <ushort, ushort> >();
            CallStack          = new Stack <CallStackEntry>();
            MachineStack       = new Stack <StackEntry>();
            _oldSp             = IsAnApp ? TopStackApp : (ushort)0xFFFF;
            SetupInternalBreakpoints();
        }
Example #2
0
        public void EndDebug()
        {
            IsAnApp = false;

            if (_debugger == null)
            {
                return;
            }

            _debugger.EndDebug();
            _debugger = null;
        }
Example #3
0
        public void EndDebug()
        {
            IsAnApp = false;

            if (_debugger == null)
            {
                return;
            }

            _debugger.OnBreakpoint -= BreakpointHit;
            _debugger.EndDebug();
            _debugger.Dispose();
            _debugger = null;

            foreach (var breakpoint in WabbitcodeBreakpointManager.Breakpoints)
            {
                breakpoint.UpdateAddress(null);
            }
        }