示例#1
0
void CachedInterpreter::Run()
{
  while (!CPU::GetState())
  {
    SingleStep();
  }
}
void BasicTaskScheduler0::doEventLoop(char* watchVariable) {
  // Repeatedly loop, handling readble sockets and timed events:
  while (1) {
    if (watchVariable != NULL && *watchVariable != 0) break;
    SingleStep();
  }
}
示例#3
0
// The Play, Stop, Step, Skip, Go to PC and Show PC buttons go here
void CCodeWindow::OnCodeStep(wxCommandEvent& event)
{
	switch (event.GetId())
	{
		case IDM_STEP:
			SingleStep();
			break;

		case IDM_STEPOVER:
			StepOver();
			break;

		case IDM_TOGGLE_BREAKPOINT:
			ToggleBreakpoint();
			break;

		case IDM_SKIP:
			PC += 4;
			Update();
			break;

		case IDM_SETPC:
			PC = codeview->GetSelection();
			Update();
			break;

		case IDM_GOTOPC:
			JumpToAddress(PC);
			break;
	}

	UpdateButtonStates();
	// Update all toolbars in the aui manager
	Parent->UpdateGUI();
}
示例#4
0
void Step()
{
	size_t lim = (GCSTEPSIZE/100) * StepMul;
	size_t olim;
	if (lim == 0)
	{
		lim = (~(size_t)0) / 2;		// no limit
	}
	Dept += AllocBytes - Threshold;
	do
	{
		olim = lim;
		lim -= SingleStep();
	} while (olim > lim && State != GCS_Pause);
	if (State != GCS_Pause)
	{
		if (Dept < GCSTEPSIZE)
		{
			Threshold = AllocBytes + GCSTEPSIZE;	// - lim/StepMul
		}
		else
		{
			Dept -= GCSTEPSIZE;
			Threshold = AllocBytes;
		}
	}
	else
	{
		assert(AllocBytes >= Estimate);
		SetThreshold();
	}
	StepCount++;
}
示例#5
0
void MPTaskScheduler::doEventLoop(char* watchVariable) {
	// Repeatedly loop, handling readble sockets and timed events:
	//for (int i=0; i < 10;++i)
	{
		//    if (watchVariable != NULL && *watchVariable != 0) break;
		SingleStep(1000000LL); //delay time is in micro seconds
	} 
}
示例#6
0
int
InterpreterCpu::Run( void )
{
	int status = 0;

	while( (status = SingleStep()) == 0 );

	return status;
}
示例#7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QFont f("Helvetica",10);
    this->setFont(f);

    LifeField = 0;
    OptionGroup = 0;
    GroupLayout = 0;
    isSimulationOn = false;
    LifeCount = 0;
    IterationCount = 0;


    WindowLayout= new QHBoxLayout;

    QWidget * mycentralwidget = new QWidget;
    mycentralwidget->setLayout(WindowLayout);

    this->setCentralWidget(mycentralwidget);
    this->setWindowTitle("Gra w Życie");

    connect(this, SIGNAL(CellsChanged(int,int)), &Algorithm, SLOT(NewDimension(int,int)));
    connect(&Algorithm, SIGNAL(CellChanged(int,int,bool)),this, SLOT(FeedCell(int,int,bool)));
    connect(&Algorithm, SIGNAL(ChangeStatus(int,int)), this, SLOT(StatusUpdate(int,int)));
    connect(this, SIGNAL(CellsChanged(int,int,bool)), &Algorithm, SLOT(CellModified(int,int,bool)));
    connect(this, SIGNAL(FeedsChanger(int)), &Algorithm, SLOT(FeedsStatus(int)));
    //connect(&Algorithm, SIGNAL(Clear()),this, SLOT(CleanNow()));

    InitLifeField();
    InitGroupBox();
    RowsChanged();
    ColumnsChanged();


this->setMinimumSize(700, 480);

    connect(ColumnChanger, SIGNAL(valueChanged(int)), this, SLOT(ColumnsChanged()));
    connect(RowChanger, SIGNAL(valueChanged(int)), this, SLOT(RowsChanged()));
    connect(Quiter, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(Generator, SIGNAL(clicked()),this, SLOT(GenerateField()) );
    connect(Cleaner, SIGNAL(clicked()),this, SLOT(CleanNow()));
    connect(LifeField, SIGNAL(cellClicked(int, int)), this, SLOT(FeedCell(int, int)));
    connect(Starter,SIGNAL(clicked()),this ,SLOT(SimulationTrigger()));
    connect(OneMove,SIGNAL(clicked()),&Algorithm ,SLOT(SingleStep()));
    connect(comboBox, SIGNAL(activated(QString)), this, SLOT(Prepared(QString)));

    connect(this,SIGNAL(StartSimulation()), &Algorithm, SLOT(SetTimer()));
    connect(this, SIGNAL(StopSimulation()),&Algorithm, SLOT(StopTimer()));


    qsrand(QTime::currentTime().msecsTo(QTime(0,0,0,0)));

}
void CachedInterpreter::Run()
{
	while (!PowerPC::GetState())
	{
		SingleStep();
	}

	// Let the waiting thread know we are done leaving
	PowerPC::FinishStateMove();
}
示例#9
0
文件: pr_08_1.c 项目: qnu/mdoch
int main (int argc, char **argv)
{
  GetNameList (argc, argv);
  PrintNameList (stdout);
  SetParams ();
  SetupJob ();
  moreCycles = 1;
  while (moreCycles) {
    SingleStep ();
    if (stepCount >= stepLimit) moreCycles = 0;
  }
}
示例#10
0
void FullGC()
{
	if (State <= GCS_Propagate)
	{
		// Reset sweep mark to sweep all elements (returning them to white)
		SweepPos = &Root;
		// Reset other collector lists
		Gray = NULL;
		State = GCS_Sweep;
	}
	// Finish any pending sweep phase
	while (State != GCS_Finalize)
	{
		SingleStep();
	}
	MarkRoot();
	while (State != GCS_Pause)
	{
		SingleStep();
	}
	SetThreshold();
}
示例#11
0
BOOL CGDIThread::InitInstance()
{
	// thread setup
	m_dc.Attach(m_hDC);

	// loop but check for kill notification
	while (WaitForSingleObject(m_hEventKill, 0) == WAIT_TIMEOUT)
		SingleStep();

	// thread cleanup
	m_dc.Detach();

	// avoid entering standard message loop by returning FALSE
	return FALSE;
}
示例#12
0
文件: cpu.cpp 项目: ryanhrob/d2cpu
void CCpu::Start()
{
    iIsRunning = true;
    while(iIsRunning)
    {
        while(SingleStep() && iIsRunning);
        if(iIsRunning)
        {
            //We are halted (IE SUB PC, 1 or equivelent) so instead of busy 
            //waiting we block until an interrupt comes in.
            iHaveInterruptCondition->Lock();
            while(iInterruptQueue.IsEmpty())
            {
                iHaveInterruptCondition->WaitForCondition();
            }
            iHaveInterruptCondition->Unlock();
        }
    }
}
示例#13
0
void CCodeWindow::StepOver()
{
	if (CCPU::IsStepping())
	{
		UGeckoInstruction inst = Memory::Read_Instruction(PC);
		if (inst.LK)
		{
			PowerPC::breakpoints.Add(PC + 4, true);
			CCPU::EnableStepping(false);
			JumpToAddress(PC);
			Update();
		}
		else
			SingleStep();

		UpdateButtonStates();
		// Update all toolbars in the aui manager
		Parent->UpdateGUI();
	}
}
示例#14
0
void DbgEntry (void)
/* Start up the debugger */
{
    static unsigned char FirstTime = 1;
    char c;
    char done;

    /* If this is the first call, setup the display */
    if (FirstTime) {
        FirstTime = 0;

        /* Draw the window, default active frame is ASM frame */
        RedrawStatic (WIN_ASM);
        InitAsm ();
        InitReg ();
        InitStack ();
        InitCStack ();
        UpdateDump ();
    }

    /* Only initialize variables here, don't do a display update. The actual
     * display update will be done while waiting for user input.
     */
    AsmHome ();
    UpdateReg ();               /* Must update this (static later) */
    StackHome ();
    CStackHome ();

    /* Wait for user input */
    done = 0;
    while (!done) {
        c = Frames [ActiveFrame]->fd_func ();
        switch (c) {

            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
                ActivateFrame (c - '1', 0);
                break;

            case '?':
#ifdef CH_F1
            case CH_F1:
#endif
                HelpHandler ();
                break;

            case 'u':
#ifdef CH_F3
            case CH_F3:
#endif
                /* Go until return */
                SetRTSBreak ();
                done = 1;
                break;

            case 'h':
#ifdef CH_F4
            case CH_F4:
#endif
                /* Go to cursor, only possible if cursor not at current PC */
                if (AsmAddr != brk_pc) {
                    DbgSetTmpBreak (AsmAddr);
                    done = 1;
                }
                break;

            case ' ':
#ifdef CH_F7
            case CH_F7:
#endif
                SingleStep (1);
                if (DbgTmpBreaksOk ()) {
                    /* Could set breakpoints */
                    done = 1;
                }
                break;

            case '\n':
#ifdef CH_F8
            case CH_F8:
#endif
                SingleStep (0);
                if (DbgTmpBreaksOk ()) {
                    /* Could set breakpoints */
                    done = 1;
                }
                break;

            case 'c':
            case 0:
                done = 1;
                break;

            case 's':
                /* Skip instruction */
                brk_pc += DbgDisAsmLen (brk_pc);
                InitAsm ();
                break;

            case 'r':
                /* Redraw screen */
                Redraw (ActiveFrame);
                break;

            case 'q':
                /* Quit program */
                clrscr ();
                exit (1);

        }
    }
}
示例#15
0
void MPTaskScheduler::doEventLoop(volatile char* watchVariable)
{
  // Handle readble sockets and timed events:
  SingleStep(1000000LL);  // unit = micro seconds
}