Debugging hacks.
authorRonald G. Minnich <rminnich@google.com>
Wed, 19 Mar 2014 02:41:49 +0000 (19:41 -0700)
committerRonald G. Minnich <rminnich@google.com>
Wed, 19 Mar 2014 02:41:49 +0000 (19:41 -0700)
Note that offset is 17 in the Tread to cs. Bogus. How's it
getting set to 17?

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
tests/cs.c
tests/csquery.c

index 203a47d..7d2e993 100644 (file)
@@ -746,6 +746,8 @@ rread(Job *job, Mfile *mf)
                }
 
                /* give back a single reply (or part of one) */
+               printf("mf->reply[%d] is %s; off %d, toff %d\n", 
+                               i, mf->reply[i], off, toff);
                job->reply.data = mf->reply[i] + (off - toff);
                if(cnt > toff - off + n)
                        n = toff - off + n;
@@ -965,12 +967,15 @@ sendmsg(Job *job, char *err)
                job->reply.type = job->request.type+1;
        }
        job->reply.tag = job->request.tag;
+       if (job->reply.type == Rread && job->reply.data)
+               hexdump(stdout, job->reply.data, job->reply.count);
        n = convS2M(&job->reply, mdata, sizeof mdata);
        if(n == 1){
                fprintf(stderr,  "CS:sendmsg convS2M of %F returns 0", &job->reply);
                abort();
        }
        //lock(&joblock);
+       hexdump(stdout, mdata, n);
        if(job->flushed == 0)
                if(write(mfd[1], mdata, n)!=n)
                        error(1, 0, "%s: %r","mount write");
index 283007a..3d34401 100644 (file)
@@ -52,11 +52,10 @@ printf("CSQUERY:ask %d about :%s:\n", fd, addr);
        if (!statusonly) {
 printf("CSQUERY:lseek\n");
                lseek(fd, 0, 0);
-printf("CSQUERY:now read\n");
+printf("CSQUERY:now read:");
                while ((n = read(fd, buf, sizeof(buf) - 1)) > 0) {
-printf("CSQUERY:got %d bytes\n", n);
                        buf[n] = 0;
-                       printf("CSQUERY:%s\n", buf);
+                       printf("%s\n", buf);
                }
 printf("CSQUERY:done reading ... %s\n", buf);
        }