X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshot-interface.cc;h=c22b8712b32937cbd415fb9f2ab7d1039e8c97a8;hb=ff6281947505d1b5bf6491dbfeaa27d5d41ab964;hp=8d7591b82efa1afccb5e00a3b5bb990c5b7447fe;hpb=f01c21655bce58ff70b0e8936f2579a7beeafad4;p=model-checker.git diff --git a/snapshot-interface.cc b/snapshot-interface.cc index 8d7591b..c22b871 100644 --- a/snapshot-interface.cc +++ b/snapshot-interface.cc @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -16,7 +15,7 @@ #define MYBINARYNAME "model" #define MYLIBRARYNAME "libmodel.so" -#define MAPFILE_FORMAT "/proc/%d/maps" +#define MAPFILE "/proc/self/maps" SnapshotStack * snapshotObject; @@ -73,12 +72,10 @@ static void SnapshotGlobalSegments(){ * library to snapshot them. */ static void SnapshotGlobalSegments(){ - int pid = getpid(); - char buf[9000], filename[100]; + char buf[9000]; FILE *map; - sprintf(filename, MAPFILE_FORMAT, pid); - map = fopen(filename, "r"); + map = fopen(MAPFILE, "r"); if (!map) { perror("fopen"); exit(EXIT_FAILURE); @@ -124,7 +121,7 @@ int SnapshotStack::backTrackBeforeStep(int seqindex) { } struct stackEntry *tmp=stack; stack=stack->next; - MYFREE(tmp); + model_free(tmp); } }