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;
|
return 0;
|
||||||
} else if (read_result == read_result_pending) {
|
} else if (read_result == read_result_pending) {
|
||||||
if (running) {
|
if (running) {
|
||||||
/*
|
|
||||||
cycles = MAX_STEP_CYCLES;
|
cycles = MAX_STEP_CYCLES;
|
||||||
brk = vbEmulate(sim, &cycles);
|
brk = vbEmulate(sim, &cycles);
|
||||||
*/
|
|
||||||
cycles = 0;
|
|
||||||
brk = 0;
|
|
||||||
if (brk) {
|
if (brk) {
|
||||||
/* We hit a breakpoint */
|
/* 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 {
|
} else {
|
||||||
sleep_nanos((MAX_STEP_CYCLES - cycles) * 50);
|
sleep_nanos((MAX_STEP_CYCLES - cycles) * 50);
|
||||||
}
|
}
|
||||||
|
@ -137,9 +146,11 @@ int main(int argc, char** argv) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* relevant state at the start of the physics sim's main */
|
/* relevant state at the start of the physics sim's main */
|
||||||
|
/*
|
||||||
vbSetProgramCounter(sim, 0x070002ba);
|
vbSetProgramCounter(sim, 0x070002ba);
|
||||||
vbSetProgramRegister(sim, 3, 0x0500ffc0);
|
vbSetProgramRegister(sim, 3, 0x0500ffc0);
|
||||||
vbSetProgramRegister(sim, 4, 0x05008000);
|
vbSetProgramRegister(sim, 4, 0x05008000);
|
||||||
|
*/
|
||||||
|
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
char *end;
|
char *end;
|
||||||
|
|
Loading…
Reference in New Issue