示例#1
0
        public InprocDebugger( Host host )
        {
            this.Host = host;
            this.DebugHost = host.Debugger;
            this.Window = new DebuggerWindow( this );
            this.Tools = new List<DebuggerTool>();

            this.State = DebuggerState.Idle;
            this.Breakpoints = new BreakpointManager( this );
            this.CodeCache = new CodeCache( this );
            this.UserData = new UserDataStore();

            this.SetupNavigation();

            // Initialize tools...
            // ...
            this.CallstackTool = new CallstackTool( this );
            this.Tools.Add( this.CallstackTool );
            this.CodeTool = new CodeTool( this );
            this.Tools.Add( this.CodeTool );
            this.LogTool = new LogTool( this );
            this.Tools.Add( this.LogTool );
            this.MemoryTool = new MemoryTool( this );
            this.Tools.Add( this.MemoryTool );
            this.StatisticsTool = new StatisticsTool( this );
            this.Tools.Add( this.StatisticsTool );
            this.ThreadsTool = new ThreadsTool( this );
            this.Tools.Add( this.ThreadsTool );
            // ...

            this.Window.Show();

            this.CodeTool.Show( this.Window.DockPanel );
            this.LogTool.Show( this.Window.DockPanel );
            this.ThreadsTool.Show( this.Window.DockPanel );

            WeifenLuo.WinFormsUI.Docking.DockPane dp;
            dp = this.Window.DockPanel.DockPaneFactory.CreateDockPane( this.CodeTool, WeifenLuo.WinFormsUI.Docking.DockState.Document, true );
            this.StatisticsTool.Show( dp, WeifenLuo.WinFormsUI.Docking.DockAlignment.Right, 0.45 );
            dp = this.Window.DockPanel.DockPaneFactory.CreateDockPane( this.LogTool, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom, true );
            this.CallstackTool.Show( dp, WeifenLuo.WinFormsUI.Docking.DockAlignment.Right, 0.24 );

            this.MemoryTool.Show( this.StatisticsTool.DockHandler.Pane, this.StatisticsTool );

            this.Host.Debugger.Activate( this, Environment.MachineName, Environment.UserName, "InprocDebugger 1.0" );

            foreach( DebuggerTool tool in this.Tools )
                tool.OnAttached();
        }
示例#2
0
        public Host( string[] args )
        {
            // Ensure settings are proper
            if( Properties.Settings.Default.PluginSearchPaths == null )
                Properties.Settings.Default.PluginSearchPaths = new System.Collections.Specialized.StringCollection();

            #if DEBUG
            string PluginPath = @"C:\Dev\Noxa.Emulation\trunk\debug\";
            if( Properties.Settings.Default.PluginSearchPaths.Contains( PluginPath ) == false )
                Properties.Settings.Default.PluginSearchPaths.Add( PluginPath );
            #endif

            Properties.Settings.Default.Save();

            _debugHost = new DebugHost( this );
            Diag.Instance = _debugHost;

            _logger = new Logger();
            _player = new Player( this );

            this.Load();

            // If we have args, try to start the player
            if( args.Length > 0 )
            {
                bool debug = false;
                string path = null;
                foreach( string arg in args )
                {
                    if( ( arg == "--debug" ) ||
                        ( arg == "-d" ) )
                        debug = true;
                    else
                    {
                        // ??
                        path = arg;
                    }
                }
                if( path != null )
                    _player.StartGameDirect( path, debug );
            }
        }
示例#3
0
        public bool Connect( string host )
        {
            this.Host = ( DebugHost )Activator.GetObject( typeof( DebugHost ), string.Format( "tcp://{0}:{1}/DebugHost", host, DebugHost.ServerPort ) );
            try
            {
                this.Host.Ping();
            }
            catch( Exception )
            {
                Debug.WriteLine( "EmuDebugger::Connect: ping failed" );// + ex.ToString() );
                return false;
            }

            this.Host.Activate( this, Environment.MachineName, Environment.UserName, "RemoteDebugger 1.0" );

            this.IsConnected = true;
            return true;
        }