Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check return value for posix_memalign.
[simgrid.git] / src / mc / mc_global.c
index 47e6c78..16ebebe 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2013. The SimGrid Team.
+/* Copyright (c) 2008-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -184,7 +184,7 @@ static dw_location_t MC_dwarf_get_location(xbt_dict_t location_list, char *expr)
 
   if(location_list != NULL){
     
-    char *key = bprintf("%d", (int)strtoul(expr, NULL, 16));
+    char *key = bprintf("%lu", strtoul(expr, NULL, 16));
     loc->type = e_dw_loclist;
     loc->location.loclist =  (xbt_dynar_t)xbt_dict_get_or_null(location_list, key);
     if(loc->location.loclist == NULL)
@@ -403,7 +403,7 @@ static xbt_dict_t MC_dwarf_get_location_list(const char *elf_file){
     }
 
 
-    char *key = bprintf("%d", (int)strtoul((char *)xbt_dynar_get_as(split, 0, char *), NULL, 16));
+    char *key = bprintf("%lu", strtoul((char *)xbt_dynar_get_as(split, 0, char *), NULL, 16));
     xbt_dict_set(location_list, key, loclist, NULL);
     xbt_free(key);
     
@@ -742,7 +742,7 @@ static void MC_dwarf_get_variables(const char *elf_file, xbt_dict_t location_lis
                   xbt_dynar_free(&split2);
                   split2 = xbt_str_split(loc_expr, " ");
                   if(strcmp(elf_file, xbt_binary_name) != 0)
-                    var->address.address = (char *)start_text_libsimgrid + (long)((void *)strtoul(xbt_dynar_get_as(split2, xbt_dynar_length(split2) - 1, char*), NULL, 16));
+                    var->address.address = (char *)start_text_libsimgrid + strtoul(xbt_dynar_get_as(split2, xbt_dynar_length(split2) - 1, char*), NULL, 16);
                   else
                     var->address.address = (void *)strtoul(xbt_dynar_get_as(split2, xbt_dynar_length(split2) - 1, char*), NULL, 16);
                 }else{
@@ -755,7 +755,7 @@ static void MC_dwarf_get_variables(const char *elf_file, xbt_dict_t location_lis
               global_address = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));
               xbt_str_rtrim(global_address, ")");
               if(strcmp(elf_file, xbt_binary_name) != 0)
-                var->address.address = (char *)start_text_libsimgrid + (long)((void *)strtoul(global_address, NULL, 16));
+                var->address.address = (char *)start_text_libsimgrid + strtoul(global_address, NULL, 16);
               else
                 var->address.address = (void *)strtoul(global_address, NULL, 16);
               xbt_free(global_address);
@@ -1760,9 +1760,12 @@ void MC_init(){
   MC_ignore_global_variable("counter"); /* Static variable used for tracing */
   MC_ignore_global_variable("maestro_stack_start");
   MC_ignore_global_variable("maestro_stack_end");
+
   MC_ignore_heap(&(simix_global->process_to_run), sizeof(simix_global->process_to_run));
   MC_ignore_heap(&(simix_global->process_that_ran), sizeof(simix_global->process_that_ran));
+  MC_ignore_heap(simix_global->process_to_run, sizeof(*(simix_global->process_to_run)));
+  MC_ignore_heap(simix_global->process_that_ran, sizeof(*(simix_global->process_that_ran)));
+  
   smx_process_t process;
   xbt_swag_foreach(process, simix_global->process_list){
     MC_ignore_heap(&(process->process_hookup), sizeof(process->process_hookup));
@@ -1872,7 +1875,7 @@ void MC_modelcheck_safety(void)
   MC_SET_RAW_MEM;
   /* Save the initial state */
   initial_state_safety = xbt_new0(s_mc_global_t, 1);
-  initial_state_safety->snapshot = MC_take_snapshot();
+  initial_state_safety->snapshot = MC_take_snapshot(0);
   MC_UNSET_RAW_MEM;
 
   MC_dpor();