Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : ignore global variables corresponding to a counter for coverage
[simgrid.git] / src / mc / mc_global.c
index 6ad2f2c..25de83a 100644 (file)
@@ -172,6 +172,8 @@ void MC_init(){
   get_libsimgrid_plt_section();
   get_binary_plt_section();
 
+  MC_ignore_data_bss(&end_raw_heap, sizeof(end_raw_heap));
+
   /* Get global variables */
   MC_get_global_variables(xbt_binary_name);
   MC_get_global_variables(libsimgrid_path);
@@ -183,11 +185,11 @@ void MC_init(){
   MC_ignore_stack("__ex_cleanup", "*");
   MC_ignore_stack("__ex_mctx_en", "*");
   MC_ignore_stack("__ex_mctx_me", "*");
+  MC_ignore_stack("__xbt_ex_ctx_ptr", "*");
   MC_ignore_stack("_log_ev", "*");
   MC_ignore_stack("_throw_ctx", "*");
   MC_ignore_stack("ctx", "*");
 
-
   if(raw_mem_set)
     MC_SET_RAW_MEM;
 
@@ -220,9 +222,11 @@ void MC_modelcheck_safety(void)
   if(_surf_mc_visited > 0){
     MC_init();
   }else{
+    MC_SET_RAW_MEM;
     MC_init_memory_map_info();
     get_libsimgrid_plt_section();
     get_binary_plt_section();
+    MC_UNSET_RAW_MEM;
   }
 
   MC_dpor_init();
@@ -1008,53 +1012,6 @@ xbt_dict_t MC_get_location_list(const char *elf_file){
   return location_list;
 }
 
-char *get_libsimgrid_path(){
-
-  char *command = bprintf("ldd %s", xbt_binary_name);
-  
-  FILE *fp = popen(command, "r");
-
-  if(fp == NULL){
-    perror("popen for ldd failed");
-    xbt_abort();
-  }
-
-  char *line;
-  ssize_t read;
-  size_t n = 0;
-  xbt_dynar_t split;
-  
-  while((read = getline(&line, &n, fp)) != -1){
-  
-    if(n == 0)
-      continue;
-
-    /* Wipeout the new line character */
-    line[read - 1] = '\0';
-
-    xbt_str_strip_spaces(line);
-    xbt_str_ltrim(line, NULL);
-    split = xbt_str_split(line, " ");
-
-    if(strncmp((char *)xbt_dynar_get_as(split, 0, char *), "libsimgrid.so", 13) == 0){
-      free(line);
-      free(command);
-      pclose(fp);
-      return ((char *)xbt_dynar_get_as(split, 2, char *));
-    }
-
-    xbt_dynar_free(&split);
-    
-  }
-
-  free(line);
-  free(command);
-  pclose(fp);
-
-  return NULL;
-  
-}
-
 static dw_frame_t get_frame_by_offset(xbt_dict_t all_variables, unsigned long int offset){
 
   xbt_dict_cursor_t cursor = NULL;
@@ -1761,6 +1718,7 @@ static void MC_get_global_variables(char *elf_file){
        || (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".data") == 0)
        || (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".bss") == 0)
        || (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "stderr", 6) == 0)
+       || (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "counter", 7) == 0)
        || ((size_t)strtoul(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 2, char*), NULL, 16) == 0))
       continue;