}
static void P_read(void *p, size_t sz, const char *what) {
+ long pos = ftell(Tinputfile);
ssize_t got = fread(p,1,sz,Tinputfile);
Pcheckinput();
assert(got==sz);
if (stdout_enable && sz) {
- fprintf(stdout,"%s:",what);
+ fprintf(stdout,"%8lx %8s:",pos,what);
P_read_dump(p, sz, +1);
if (sz<=16) {
P_read_dump((const unsigned char *)p+sz-1, sz, -1);
}
}
+#ifdef FUZZRAW_SYNC
+static void Psync(const char *exp, char *got, size_t sz, const char *what) {
+ P_read(got,sz,"syscall");
+ if (memcmp(exp,got,sz)) Pformat(what);
+}
+#endif
+
#ifdef HAVE_POLL
static void Ppollfds(struct pollfd *fds, int nfds, int *r_io) {
int fd;
Q$1(hm_args_massage($3));
}
+#ifdef FUZZRAW_SYNC
+ static const char sync_expect[]= "$1";
+ static char sync_got[sizeof(sync_expect)];
+ Psync(sync_expect, sync_got, sizeof(sync_got), "sync lost: exp=$1");
+#endif
+
m4_define(`hm_rv_succfail',`
r= P_succfail();
if (r<0) return r;