1
0

debug regressions: some whitespace and null ptr cleanup

This commit is contained in:
Megan Wachs 2017-12-19 14:57:31 -08:00
parent 96dd5d8c38
commit b643f3dca6
3 changed files with 20 additions and 17 deletions

View File

@ -24,9 +24,9 @@ extern "C" int jtag_tick
// TODO: Pass in real port number
jtag = new remote_bitbang_t(0);
}
jtag->tick(jtag_TCK, jtag_TMS, jtag_TDI, jtag_TRSTn, jtag_TDO);
return jtag->done() ? (jtag->exit_code() << 1 | 1) : 0;
}

View File

@ -220,6 +220,9 @@ done_processing:
jtag = new remote_bitbang_t(0);
dtm = new dtm_t(htif_argc, htif_argv);
jtag = new remote_bitbang_t(0);
dtm = new dtm_t(to_dtm);
signal(SIGTERM, handle_sigterm);
bool dump;
@ -232,13 +235,13 @@ done_processing:
dump = tfp && trace_count >= start;
if (dump)
tfp->dump(static_cast<vluint64_t>(trace_count * 2));
#endif
#endif
tile->clock = 1;
tile->eval();
#if VM_TRACE
if (dump)
tfp->dump(static_cast<vluint64_t>(trace_count * 2 + 1));
#endif
#endif
trace_count ++;
}
tile->reset = 0;

View File

@ -28,7 +28,7 @@ remote_bitbang_t::remote_bitbang_t(uint16_t port) :
strerror(errno), errno);
abort();
}
fcntl(socket_fd, F_SETFL, O_NONBLOCK);
int reuseaddr = 1;
if (setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr,
@ -37,25 +37,25 @@ remote_bitbang_t::remote_bitbang_t(uint16_t port) :
strerror(errno), errno);
abort();
}
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_port = htons(port);
if (bind(socket_fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
fprintf(stderr, "remote_bitbang failed to bind socket: %s (%d)\n",
strerror(errno), errno);
abort();
}
if (listen(socket_fd, 1) == -1) {
fprintf(stderr, "remote_bitbang failed to listen on socket: %s (%d)\n",
strerror(errno), errno);
abort();
}
socklen_t addrlen = sizeof(addr);
if (getsockname(socket_fd, (struct sockaddr *) &addr, &addrlen) == -1) {
fprintf(stderr, "remote_bitbang getsockname failed: %s (%d)\n",
@ -68,7 +68,7 @@ remote_bitbang_t::remote_bitbang_t(uint16_t port) :
tdi = 1;
trstn = 1;
quit = 0;
printf("Listening on port %d\n",
ntohs(addr.sin_port));
fflush(stdout);
@ -112,11 +112,11 @@ void remote_bitbang_t::tick(
} else {
this->accept();
}
* jtag_tck = tck;
* jtag_tms = tms;
* jtag_tdi = tdi;
* jtag_trstn = trstn;
* jtag_trstn = trstn;
}
@ -153,13 +153,13 @@ void remote_bitbang_t::execute_command()
again = 0;
}
}
fprintf(stderr, "Received a command %c\n", command);
int dosend = 0;
char tosend = '?';
switch (command) {
case 'B': /* fprintf(stderr, "*BLINK*\n"); */ break;
case 'b': /* fprintf(stderr, "_______\n"); */ break;
@ -191,7 +191,7 @@ void remote_bitbang_t::execute_command()
}
}
}
if (quit) {
// The remote disconnected.
fprintf(stderr, "Remote end disconnected\n");