valgrind process that there is new data.
Returns True if write is ok, False if there was a problem. */
static
-Bool write_buf(int fd, char* buf, int size, const char* desc, Bool notify)
+Bool write_buf(int fd, const char* buf, int size, const char* desc, Bool notify)
{
int nrwritten;
int nrw;
}
/* Read a packet from fromfd, with error checking,
- and store it in BUF.
- Returns length of packet, or -1 if error or -2 if EOF.
- Writes ack on ackfd */
-
+ and store it in BUF.
+ If checksum incorrect, writes a - on ackfd.
+ Returns length of packet, or -1 if error or -2 if EOF. */
static int
getpkt (char *buf, int fromfd, int ackfd)
{
add_written(1);
}
- DEBUG(2, "getpkt (\"%s\"); [sending ack] \n", buf);
- if (write (ackfd, "+", 1) != 1)
- ERROR(0, "error when writing + (ack)\n");
- else
- add_written(1);
+ DEBUG(2, "getpkt (\"%s\"); [no ack] \n", buf);
return bp - buf;
}
}
from_pid = open_fifo(to_gdb_from_pid, O_RDONLY,
"read cmd result from pid");
+
+ /* Enable no ack mode. */
+ write_buf(to_pid, "$QStartNoAckMode#b0", 19, "write start no ack mode",
+ /* notify */ True);
+ buflen = getpkt(buf, from_pid, to_pid);
+ if (buflen != 2 || strcmp(buf, "OK") != 0) {
+ if (buflen != 2)
+ ERROR (0, "no ack mode: unexpected buflen %d\n", buflen);
+ else
+ ERROR (0, "no ack mode: unexpected packet %s\n", buf);
+ }
for (nc = 0; nc <= last_command; nc++) {
fprintf (stderr, "sending command %s to pid %d\n", commands[nc], pid);