it runs!
This commit is contained in:
		
							parent
							
								
									431377f92e
								
							
						
					
					
						commit
						57403690ff
					
				
							
								
								
									
										19
									
								
								main.c
								
								
								
								
							
							
						
						
									
										19
									
								
								main.c
								
								
								
								
							| 
						 | 
				
			
			@ -46,14 +46,23 @@ int server(int connfd, VB *sim) {
 | 
			
		|||
            return 0;
 | 
			
		||||
        } else if (read_result == read_result_pending) {
 | 
			
		||||
            if (running) {
 | 
			
		||||
                /*
 | 
			
		||||
                cycles = MAX_STEP_CYCLES;
 | 
			
		||||
                brk = vbEmulate(sim, &cycles);
 | 
			
		||||
                */
 | 
			
		||||
                cycles = 0;
 | 
			
		||||
                brk = 0;
 | 
			
		||||
                if (brk) {
 | 
			
		||||
                    /* We hit a breakpoint */ 
 | 
			
		||||
                    if (brk == -1) {
 | 
			
		||||
                        /* actually, not implemented */
 | 
			
		||||
                        running = false;
 | 
			
		||||
                        rdb_response_begin_packet(&res);
 | 
			
		||||
                        rdb_response_write_str(&res, "T05:thread:p1.t1;threads:p1.t1;");
 | 
			
		||||
                        result = rdb_response_send_packet(&res);
 | 
			
		||||
                        if (result != 0) {
 | 
			
		||||
                            return result;
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        fprintf(stderr, "surprising response %d from vbEmulate\n", brk);
 | 
			
		||||
                        return -1;
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    sleep_nanos((MAX_STEP_CYCLES - cycles) * 50);
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -137,9 +146,11 @@ int main(int argc, char** argv) {
 | 
			
		|||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    /* relevant state at the start of the physics sim's main */
 | 
			
		||||
    /*
 | 
			
		||||
    vbSetProgramCounter(sim, 0x070002ba);
 | 
			
		||||
    vbSetProgramRegister(sim, 3, 0x0500ffc0);
 | 
			
		||||
    vbSetProgramRegister(sim, 4, 0x05008000);
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
    if (argc > 2) {
 | 
			
		||||
        char *end;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue