/// <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;
 }
Example #2
0
        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();
        }
Example #3
0
 private void OnBreakpointRemoved( Breakpoint breakpoint )
 {
     this.BreakpointRemoved( this, new BreakpointEventArgs( breakpoint ) );
 }
Example #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();
        }
Example #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 );
        }
Example #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 ) );
 }
Example #10
0
 internal void OnBreakpointToggled( Breakpoint breakpoint )
 {
     this.Debugger.Host.CpuHook.UpdateBreakpoint( breakpoint );
     if( this.Toggled != null )
         this.Toggled( this, new BreakpointEventArgs( breakpoint ) );
 }
Example #11
0
 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 );
 }