From: Brian Norris Date: Sat, 3 Nov 2012 22:31:02 +0000 (-0700) Subject: Merge remote-tracking branch 'origin/master' into pldi13 X-Git-Tag: pldi2013~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4ee9f33221f490599093e74b527ba7e401133f96;hp=c2d7fa973e562c194eb732d8dc58ab7659b7a2ee;p=model-checker.git Merge remote-tracking branch 'origin/master' into pldi13 --- diff --git a/common.h b/common.h index 50410ea..81b2672 100644 --- a/common.h +++ b/common.h @@ -20,6 +20,7 @@ void assert_hook(void); +#ifdef CONFIG_ASSERT #define ASSERT(expr) \ do { \ if (!(expr)) { \ @@ -30,6 +31,10 @@ do { \ exit(EXIT_FAILURE); \ } \ } while (0) +#else +#define ASSERT(expr) \ + do { } while (0) +#endif /* CONFIG_ASSERT */ #define error_msg(...) fprintf(stderr, "Error: " __VA_ARGS__) diff --git a/config.h b/config.h index 109e8d8..227c9a9 100644 --- a/config.h +++ b/config.h @@ -9,6 +9,10 @@ /* #ifndef CONFIG_DEBUG #define CONFIG_DEBUG #endif + + #ifndef CONFIG_ASSERT + #define CONFIG_ASSERT + #endif */ /** Turn on support for dumping cyclegraphs as dot files at each diff --git a/main.cc b/main.cc index fc1b277..635b8da 100644 --- a/main.cc +++ b/main.cc @@ -72,8 +72,10 @@ static void parse_options(struct model_params *params, int *argc, char ***argv) break; } } - (*argc) -= optind; - (*argv) += optind; + (*argv)[optind - 1] = (*argv)[0]; + (*argc) -= (optind - 1); + (*argv) += (optind - 1); + optind = 1; if (error) print_usage(params); diff --git a/snapshot-interface.cc b/snapshot-interface.cc index 47fafa5..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); diff --git a/snapshotimp.h b/snapshotimp.h index 2e4929d..b03d285 100644 --- a/snapshotimp.h +++ b/snapshotimp.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #define SHARED_MEMORY_DEFAULT (100 * ((size_t)1 << 20)) // 100mb for the shared memory #define STACK_SIZE_DEFAULT (((size_t)1 << 20) * 20) // 20 mb out of the above 100 mb for my stack