/// <summary>
 /// Initializes a new <see cref="BreakpointEventArgs"/> instance with the given parameters.
 /// </summary>
 /// <param name="breakpoint">The <see cref="Breakpoint"/> the event is about.</param>
 public BreakpointEventArgs( Breakpoint breakpoint )
 {
     Debug.Assert( breakpoint != null );
     if( breakpoint == null )
         throw new ArgumentNullException( "breakpoint" );
     this.Breakpoint = breakpoint;
 }
        private void addBreakpointToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Instruction instr = this.GetContextInstruction();
            if( instr == null )
                return;

            Breakpoint bp = new Breakpoint( _debugger.AllocateID(), BreakpointType.CodeExecute, instr.Address );
            _debugger.Breakpoints.Add( bp );

            this.ContextReturn();
        }
Exemple #3
0
 private void OnBreakpointRemoved( Breakpoint breakpoint )
 {
     this.BreakpointRemoved( this, new BreakpointEventArgs( breakpoint ) );
 }
Exemple #4
0
        public void Start( uint argumentsLength, uint argumentsPointer )
        {
            uint[] registers = new uint[ 32 ];
            registers[ 4 ] = argumentsLength;
            registers[ 5 ] = argumentsPointer;
            registers[ 6 ] = 0;
            if( TlsBlock != null )
                registers[ 26 ] = TlsBlock.Address;		// TLS
            else
                registers[ 26 ] = 0;
            registers[ 28 ] = GlobalPointer;			// gp - set by cpu?
            registers[ 29 ] = StackBlock.UpperBound;

            ContextID = Kernel.Cpu.AllocateContextStorage( EntryAddress, registers );

            State = KThreadState.Ready;

            if( Diag.IsAttached == true )
            {
                Breakpoint bp = new Breakpoint( Diag.Instance.Client.AllocateID(), BreakpointType.Stepping, this.EntryAddress );
                Diag.Instance.CpuHook.AddBreakpoint( bp );
            }

            Kernel.Threads.Add( this );
            this.AddToSchedule();
        }
Exemple #5
0
        public void OnStarted( GameInformation game, Stream bootStream )
        {
            // Need to marshal all UI calls to the proper thread
            DummyDelegate del = delegate
            {
                this.Log.OnStarted();
                this.Statistics.OnStarted();

                this.View.SetStatusText( Verbosity.Normal, "Connection to emulator {0} established.", this.Host.HostString );

                this.State = DebuggerState.Running;
                this.OnStateChanged();
            };
            this.View.Invoke( del );

            // TEST
            Breakpoint bp = new Breakpoint( this.AllocateID(), BreakpointType.CodeExecute, 0x08900334 );
            //this.Breakpoints.Add( bp );
        }
Exemple #6
0
 internal void OnBreakpointToggled( Breakpoint breakpoint )
 {
     this.BreakpointToggled( this, new BreakpointEventArgs( breakpoint ) );
 }
 public void Add( Breakpoint breakpoint )
 {
     _breakpointLookup.Add( breakpoint.ID, breakpoint );
     switch( breakpoint.Type )
     {
         case BreakpointType.CodeExecute:
         case BreakpointType.MemoryAccess:
             _addressBreakpointLookup.Add( breakpoint.Address, breakpoint );
             break;
         case BreakpointType.BiosFunction:
             _biosBreakpointLookup.Add( breakpoint.Function, breakpoint );
             break;
     }
     this.OnBreakpointAdded( breakpoint );
 }
 private void OnBreakpointRemoved( Breakpoint breakpoint )
 {
     this.Debugger.Host.CpuHook.RemoveBreakpoint( breakpoint.ID );
     if( this.Removed != null )
         this.Removed( this, new BreakpointEventArgs( breakpoint ) );
 }
 private void OnBreakpointAdded( Breakpoint breakpoint )
 {
     this.Debugger.Host.CpuHook.AddBreakpoint( breakpoint );
     if( this.Added != null )
         this.Added( this, new BreakpointEventArgs( breakpoint ) );
 }
 internal void OnBreakpointToggled( Breakpoint breakpoint )
 {
     this.Debugger.Host.CpuHook.UpdateBreakpoint( breakpoint );
     if( this.Toggled != null )
         this.Toggled( this, new BreakpointEventArgs( breakpoint ) );
 }
 public void Remove( Breakpoint breakpoint )
 {
     _breakpointLookup.Remove( breakpoint.ID );
     switch( breakpoint.Type )
     {
         case BreakpointType.CodeExecute:
         case BreakpointType.MemoryAccess:
             _addressBreakpointLookup.Remove( breakpoint.Address );
             break;
         case BreakpointType.BiosFunction:
             _biosBreakpointLookup.Remove( breakpoint.Function );
             break;
     }
     this.OnBreakpointRemoved( breakpoint );
 }