From: Gabriel Corona Date: Mon, 24 Feb 2014 09:04:38 +0000 (+0100) Subject: Merge 'master' into mc X-Git-Tag: v3_11~199^2~2^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a Merge 'master' into mc Conflicts: src/mc/mc_checkpoint.c src/mc/mc_global.c src/mc/mc_private.h --- 45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a diff --cc CMakeLists.txt index 747d9fc12c,83eb99b4d7..cfae0bbc05 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -4,9 -4,12 +4,12 @@@ if(WIN32 SET(CMAKE_RC_COMPILER "windres") endif() project(SimGrid C) -if (enable_gtnets OR enable_ns3) +if (enable_gtnets OR enable_ns3 OR enable_model-checking) enable_language(CXX) endif() + + enable_language(CXX) + if (NOT DEFINED enable_smpi OR enable_smpi) # smpi is enabled by default # Call enable_language(Fortran) in order to load the build rules for # this language, needed by teshsuite/smpi/mpich-test/. Use diff --cc buildtools/Cmake/CompleteInFiles.cmake index 16f8dbaa0c,04a2a3ef9a..98cc4617c8 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@@ -212,8 -225,10 +225,11 @@@ if(enable_model-checking AND HAVE_MMALL SET(HAVE_MC 1) SET(MMALLOC_WANT_OVERRIDE_LEGACY 1) include(FindLibunwind) + include(FindLibdw) else() + if(enable_model-checking) + message(STATUS "Warning: support for model-checking has been disabled because HAVE_MMALLOC is false") + endif() SET(HAVE_MC 0) SET(MMALLOC_WANT_OVERRIDE_LEGACY 0) endif() diff --cc buildtools/Cmake/DefinePackages.cmake index 41b6fab0b5,b2d079e437..622d35ff12 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@@ -976,8 -1005,8 +1008,9 @@@ set(CMAKE_SOURCE_FILE buildtools/Cmake/Modules/FindGFortran.cmake buildtools/Cmake/Modules/FindGTnets.cmake buildtools/Cmake/Modules/FindGraphviz.cmake + buildtools/Cmake/Modules/FindLibSigc++.cmake buildtools/Cmake/Modules/FindLibunwind.cmake + buildtools/Cmake/Modules/FindLibdw.cmake buildtools/Cmake/Modules/FindLua51Simgrid.cmake buildtools/Cmake/Modules/FindNS3.cmake buildtools/Cmake/Modules/FindRngStream.cmake diff --cc src/mc/mc_global.c index f92085fc14,16ebebe384..0cda77fb7f --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@@ -474,11 -314,110 +474,10 @@@ static dw_location_t MC_dwarf_get_locat } -static xbt_dict_t MC_dwarf_get_location_list(const char *elf_file){ - - char *command = bprintf("objdump -Wo %s", elf_file); - - FILE *fp = popen(command, "r"); - - if(fp == NULL){ - perror("popen for objdump failed"); - xbt_abort(); - } - - int debug = 0; /*Detect if the program has been compiled with -g */ - - xbt_dict_t location_list = xbt_dict_new_homogeneous(NULL); - char *line = NULL, *loc_expr = NULL; - ssize_t read; - size_t n = 0; - int cursor_remove; - xbt_dynar_t split = NULL; - - while ((read = xbt_getline(&line, &n, fp)) != -1) { - - /* Wipeout the new line character */ - line[read - 1] = '\0'; - - xbt_str_trim(line, NULL); - - if(n == 0) - continue; - - if(strlen(line) == 0) - continue; - - if(debug == 0){ - - if(strncmp(line, elf_file, strlen(elf_file)) == 0) - continue; - - if(strncmp(line, "Contents", 8) == 0) - continue; - - if(strncmp(line, "Offset", 6) == 0){ - debug = 1; - continue; - } - } - - if(debug == 0){ - XBT_INFO("Your program must be compiled with -g"); - xbt_abort(); - } - - xbt_dynar_t loclist = xbt_dynar_new(sizeof(dw_location_entry_t), NULL); - - xbt_str_strip_spaces(line); - split = xbt_str_split(line, " "); - - while(read != -1 && strcmp("lowpc = strtoul((char *)xbt_dynar_get_as(split, 1, char *), NULL, 16); - new_entry->highpc = strtoul((char *)xbt_dynar_get_as(split, 2, char *), NULL, 16); - - cursor_remove =0; - while(cursor_remove < 3){ - xbt_dynar_remove_at(split, 0, NULL); - cursor_remove++; - } - - loc_expr = xbt_str_join(split, " "); - xbt_str_ltrim(loc_expr, "("); - xbt_str_rtrim(loc_expr, ")"); - new_entry->location = MC_dwarf_get_location(NULL, loc_expr); - - xbt_dynar_push(loclist, &new_entry); - - xbt_dynar_free(&split); - free(loc_expr); - - read = xbt_getline(&line, &n, fp); - if(read != -1){ - line[read - 1] = '\0'; - xbt_str_strip_spaces(line); - split = xbt_str_split(line, " "); - } - - } - - - 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); - - xbt_dynar_free(&split); - - } - - xbt_free(line); - xbt_free(command); - pclose(fp); - - return location_list; -} -- +/** \brief Finds a frame (DW_TAG_subprogram) from an DWARF offset in the rangd of this subprogram + * + * The offset can be an offset of a child DW_TAG_variable. + */ static dw_frame_t MC_dwarf_get_frame_by_offset(xbt_dict_t all_variables, unsigned long int offset){ xbt_dict_cursor_t cursor = NULL;