sscanf(buf, "%22s %p-%p [%5dK] %c%c%c/%c%c%c SM=%3s %200s\n", &type, &begin, &end, &size, &r, &w, &x, &mr, &mw, &mx, smstr, regionname);
if (w == 'w' && (strstr(regionname, MYBINARYNAME) || strstr(regionname, MYLIBRARYNAME))) {
- printf("%s\n", buf);
-
size_t len = ((uintptr_t)end - (uintptr_t)begin) / PAGESIZE;
if (len != 0)
addMemoryRegionToSnapShot(begin, len);
+ DEBUG("%s\n", buf);
DEBUG("%45s: %18p - %18p\t%c%c%c%c\n", regionname, begin, end, r, w, x, p);
}
}
exit( EXIT_FAILURE );
}
void* addr = ReturnPageAlignedAddress(si->si_addr);
+
unsigned int backingpage=snapshotrecord->lastBackingPage++; //Could run out of pages...
if (backingpage==snapshotrecord->maxBackingPages) {
printf("Out of backing pages at %p\n", si->si_addr);
siginfo_t si;
si.si_addr=ss.ss_sp;
+ si.si_code = 0;
HandlePF(SIGSEGV, &si, NULL);
snapshotrecord->lastBackingPage--; //remove the fake page we copied
#define USE_MPROTECT_SNAPSHOT 1
/* Size of signal stack */
-#define SIGSTACKSIZE 16384
+#define SIGSTACKSIZE 32768
void addMemoryRegionToSnapShot( void * ptr, unsigned int numPages );