Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid
authordegomme <augustin.degomme@unibas.ch>
Thu, 10 Mar 2016 13:44:24 +0000 (14:44 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Thu, 10 Mar 2016 13:44:24 +0000 (14:44 +0100)
42 files changed:
CMakeLists.txt
include/simgrid_config.h.in
src/bindings/java/org/simgrid/msg/Comm.java
src/bindings/java/org/simgrid/msg/File.java
src/bindings/java/org/simgrid/msg/Host.java
src/bindings/java/org/simgrid/msg/HostFailureException.java
src/bindings/java/org/simgrid/msg/HostNotFoundException.java
src/bindings/java/org/simgrid/msg/JniException.java
src/bindings/java/org/simgrid/msg/Msg.java
src/bindings/java/org/simgrid/msg/MsgException.java
src/bindings/java/org/simgrid/msg/Mutex.java
src/bindings/java/org/simgrid/msg/NativeException.java
src/bindings/java/org/simgrid/msg/Process.java
src/include/surf/maxmin.h
src/include/surf/surf.h
src/mc/ObjectInformation.hpp
src/mc/Process.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_object_info.h [deleted file]
src/portable.h [deleted file]
src/simdag/sd_daxloader.cpp
src/simdag/sd_dotloader.cpp
src/simix/ThreadContext.cpp
src/simix/smx_context.cpp
src/simix/smx_global.cpp
src/surf/surf_interface.cpp
src/xbt/cunit.c
src/xbt/dict.c
src/xbt/ex.c
src/xbt/log.c
src/xbt/mmalloc/mmprivate.h
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_main.c
src/xbt/xbt_os_file.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_str.c
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/dwarf_expression/dwarf_expression.cpp
tools/cmake/DefinePackages.cmake
tools/cmake/src/internal_config.h.in

index 73477bf..c22fc86 100644 (file)
@@ -894,7 +894,7 @@ message("##########################################")
 message("#### Content of src/internal_config.h ####")
 message("##########################################")
 file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output)
-LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8) # Pass the file header
+LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 10) # Pass the file header
 foreach(line ${config_output})
   message("   ${line}")
 endforeach()
index 4749db6..e440d19 100644 (file)
@@ -21,7 +21,7 @@
 
 #define HAVE_JEDULE     @HAVE_JEDULE@ /* Was Jedule compiled in?  */
 #define HAVE_LUA        @HAVE_LUA@ /* Was the Lua support compiled in? */
-#define HAVE_MALLOCATOR @HAVE_MALLOCATOR@ /* Whether mallocators (object pools) were activated at compilation time. */
+#define HAVE_MALLOCATOR @HAVE_MALLOCATOR@ /* Were mallocators (object pools) compiled in? */
 #define HAVE_MC         @HAVE_MC@ /* Was the model-checking compiled in? */
 #define HAVE_NS3        @HAVE_NS3@ /* Was the NS3 support compiled in? */
 
index 86c33cb..8d07c51 100644 (file)
@@ -11,13 +11,9 @@ package org.simgrid.msg;
  * between processes.
  */
 public class Comm {
-       /**
-        * Indicates if the communication is a receiving communication
-        */
+       /** Indicates if the communication is a receiving communication */
        protected boolean receiving;
-       /**
-        * Indicates if the communication is finished
-        */
+       /** Indicates if the communication is finished */
        protected boolean finished = false;
        /**
         * Represents the bind between the java comm and the
@@ -25,13 +21,9 @@ public class Comm {
         * automatically set.
         */
        private long bind = 0;
-       /**
-        * Represents the bind for the task object pointer. Don't touch it.
-        */
+       /** Represents the bind for the task object pointer. Don't touch it. */
        private long taskBind = 0;
-       /**
-        * Task associated with the comm. Beware, it can be null 
-        */
+       /** Task associated with the comm. Beware, it can be null */
        protected Task task = null;
        /**
         * Protected constructor, used by Comm factories
@@ -75,9 +67,7 @@ public class Comm {
                return task;
        }
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                org.simgrid.NativeLib.nativeInit();
index 456e474..633f1ff 100644 (file)
@@ -41,9 +41,7 @@ public class File {
         * @param nMemb is the number of elements of data to write 
         */
        public native long write(long size, long nMemb);
-       /**
-        * Close the file.      
-        */
+       /** Close the file. */
        public native void close();
 
        /** Class initializer, to initialize various JNI stuff */
index ae953ee..c15b2af 100644 (file)
@@ -49,18 +49,10 @@ public class Host {
         * @see                         Host.getByName().
         */ 
        private long bind;
-       /**
-        * Host name
-        */
        protected String name;
 
-       /**
-        * User data.
-        */ 
+       /** User data. */ 
        private Object data;
-       /**
-        *
-        */
        protected Host() {
                this.bind = 0;
                this.data = null;
@@ -84,26 +76,13 @@ public class Host {
         */ 
        public native static Host getByName(String name) 
                        throws HostNotFoundException, NullPointerException;
-       /**
-        * This static method returns the count of the installed hosts.
-        *
-        * @return                      The count of the installed hosts.
-        */ 
+       /** Counts the installed hosts. */ 
        public native static int getCount();
 
-       /**
-        * This static method return an instance to the host of the current process.
-        *
-        * @return                      The host on which the current process is executed.
-        */ 
+       /** Returns the host of the current process. */ 
        public native static Host currentHost();
 
-       /**
-        * This static method returns all of the hosts of the installed platform.
-        *
-        * @return                      An array containing all the hosts installed.
-        *
-        */ 
+       /** Returns all hosts of the installed platform. */ 
        public native static Host[] all();
 
        /** 
@@ -120,99 +99,54 @@ public class Host {
        public static native void setAsyncMailbox(String mailboxName);
 
 
-       /**
-        * This method returns the name of a host.
-        * @return                      The name of the host.
-        *
-        */ 
+       /** Returns the name of an host. */ 
        public String getName() {
                return name;
        }
 
-       /**
-        * Sets the data of the host.
-        * @param data
-        */
+       /** Sets the user data of the host. */
        public void setData(Object data) {
                this.data = data;
        } 
-       /**
-        * Gets the data of the host.
-        *
-        * @return The data object associated with the host.
-        */
+       /** Gets the user data of the host. */
        public Object getData() {
                return this.data;
        }
-
-       /**
-        * Checks whether a host has data.
-        *
-        * @return True if the host has an associated data object.
-        */
+       /** Returns true if the host has an associated data object. */
        public boolean hasData() {
                return null != this.data;
        }
 
-       /**
-        * This method start the host if it is off
-        */ 
+       /** Starts the host if it is off */ 
        public native void on();
-
-       /**
-        * This method stop the host if it is on
-        */ 
+       /** Stops the host if it is on */ 
        public native void off();
 
 
        /**
-        * This method returns the speed of the processor of a host,
+        * This method returns the speed of the processor of a host (in flops),
         * regardless of the current load of the machine.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
         */ 
        public native double getSpeed();
-
-       /**
-        * This method returns the number of core of a host.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
-        */ 
+       /** Returns the number of core of a host. */ 
        public native double getCoreNumber();
 
-       /**
-        * Returns the value of a given host property. 
-        */
+       /** Returns the value of a given host property. */
        public native String getProperty(String name);
-
-       /**
-        * Change the value of a given host property. 
-        */
+       /** Changes the value of a given host property. */
        public native void setProperty(String name, String value);
-
-       /** This method tests if a host is up and running.
-        * @return True if the host is available.
-        */
+       /** Tests if an host is up and running. */
        public native boolean isOn();
 
-       /** This methods returns the list of mount point names on an host
-        * @return An array containing all mounted storages on the host
-        */
+       /** Returns the list of mount point names on an host */
        public native Storage[] getMountedStorage();
-
-       /** This methods returns the list of storages attached to an host
-        * @return An array containing all storages (name) attached to the host
-        */
+       /** This methods returns the list of storages (names) attached to an host */
        public native String[] getAttachedStorage();
 
        /** Returns the amount of Joules consumed by that host so far */
        public native double getConsumedEnergy();
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                nativeInit();
index 01eb5b9..7070131 100644 (file)
@@ -1,5 +1,3 @@
-/* This exception is raised when looking for a non-existing host. */
-
 /* Copyright (c) 2006-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -8,9 +6,7 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when the host on which you are running has just been rebooted.
- */
+/** This exception is raised when the host on which you are running has just been rebooted. */
 public class HostFailureException extends MsgException {
        private static final long serialVersionUID = 1L;
 
@@ -18,11 +14,7 @@ public class HostFailureException extends MsgException {
        public HostFailureException() {
                super();
        }
-       /**
-        * Constructs an <code>HostFailureException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>HostFailureException</code> with a detail message. */
        public HostFailureException(String s) {
                super(s);
        }
index 86b830e..79ef54c 100644 (file)
@@ -1,5 +1,3 @@
-/* This exception is raised when looking for a non-existing host. */
-
 /* Copyright (c) 2006-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -8,9 +6,7 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when looking for a non-existing host.
- */
+/** This exception is raised when looking for a non-existing host. */
 public class HostNotFoundException extends MsgException {
        private static final long serialVersionUID = 1L;
 
@@ -18,11 +14,7 @@ public class HostNotFoundException extends MsgException {
        public HostNotFoundException() {
                super();
        }
-       /**
-        * Constructs an <code>HostNotFoundException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>HostNotFoundException</code> with a detail message. */
        public HostNotFoundException(String s) {
                super(s);
        }
index ee3cafe..322ffde 100644 (file)
@@ -16,20 +16,14 @@ public class JniException extends RuntimeException {
        private static final long serialVersionUID = 1L;
 
 
-       /**
-        * Constructs an <code>JniException</code> without a 
-        * detail message. 
-        */
+       /** Constructs an <code>JniException</code> without a detail message. */
        public JniException() {
                super();
        }
-       /**
-        * Constructs an <code>JniException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */ public JniException(String s) {
+       /** Constructs an <code>JniException</code> with a detail message. */ 
+       public JniException(String s) {
                 super(s);
-        }
+       }
        public JniException(String string, Exception e) {
                super(string,e);
        }
index 263a22f..d16eb99 100644 (file)
@@ -12,47 +12,26 @@ import org.simgrid.NativeLib;
 
 public final class Msg {
 
-       /** Retrieve the simulation time
-        * @return The simulation time.
-        */
+       /** Retrieves the simulation time */
        public final static native double getClock();
-       /**
-        * Issue a debug logging message.
-        * @param s message to log.
-        */
-       public final static native void debug(String s);
-       /**
-        * Issue an verbose logging message.
-        * @param s message to log.
-        */
-       public final static native void verb(String s);
-
-       /** Issue an information logging message
-        * @param s
-        */
-       public final static native void info(String s);
-       /**
-        * Issue an warning logging message.
-        * @param s message to log.
-        */
-       public final static native void warn(String s);
-       /**
-        * Issue an error logging message.
-        * @param s message to log.
-        */
-       public final static native void error(String s);
-       /**
-        * Issue an critical logging message.
-        * @param s message to log.
-        */
+       /** Issue a debug logging message. */
+       public final static native void debug(String msg);
+       /** Issue a verbose logging message. */
+       public final static native void verb(String msg);
+       /** Issue an information logging message */
+       public final static native void info(String msg);
+       /** Issue a warning logging message. */
+       public final static native void warn(String msg);
+       /** Issue an error logging message. */
+       public final static native void error(String msg);
+       /** Issue a critical logging message. */
        public final static native void critical(String s);
 
        /*********************************************************************************
         * Deployment and initialization related functions                               *
         *********************************************************************************/
 
-       /**
-        * The natively implemented method to initialize a MSG simulation.
+       /** Initialize a MSG simulation.
         *
         * @param args            The arguments of the command line of the simulation.
         */
@@ -61,8 +40,7 @@ public final class Msg {
        /** Tell the kernel that you want to use the energy plugin */
        public final static native void energyInit();
 
-       /**
-        * Run the MSG simulation.
+       /** Run the MSG simulation.
         *
         * The simulation is not cleaned afterward (see  
         * {@link #clean()} if you really insist on cleaning the C side), so you can freely 
@@ -75,22 +53,12 @@ public final class Msg {
        @Deprecated
        public final static void clean(){}
 
-       /**
-        * The native implemented method to create the environment of the simulation.
-        *
-        * @param platformFile    The XML file which contains the description of the environment of the simulation
-        *
-        */
+       /** Create the simulation environment by parsing a platform file. */
        public final static native void createEnvironment(String platformFile);
 
        public final static native As environmentGetRoutingRoot();
 
-       /**
-        * The method to deploy the simulation.
-        *
-        *
-        * @param deploymentFile
-        */
+       /** Starts your processes by parsing a deployment file. */
        public final static native void deployApplication(String deploymentFile);
 
        /** Example launcher. You can use it or provide your own launcher, as you wish
index bebfe32..e683264 100644 (file)
@@ -8,32 +8,16 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is an abstract class grouping all MSG-related exceptions
- *
- *  <!--
- *    DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
- *    DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
- *    DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
- *    DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
- *  -->
- */
+/** This exception is an abstract class grouping all MSG-related exceptions */
 public abstract class MsgException extends Exception {
        private static final long serialVersionUID = 1L;
 
-       /**
-        * Constructs an <code>MsgException</code> without a 
-        * detail message. 
-        */
+       /** Constructs an <code>MsgException</code> without a detail message. */
        public MsgException() {
                super();
        }
-       /**
-        * Constructs an <code>MsgException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */ 
-       public MsgException(String s) {
-               super(s);
+       /** Constructs an <code>MsgException</code> with a detail message. */ 
+       public MsgException(String msg) {
+               super(msg);
        }
 }
index ed7340b..d670f55 100644 (file)
@@ -8,7 +8,8 @@ package org.simgrid.msg;
 /** A mutex  implemented on top of SimGrid synchronization mechanisms. 
  * You can use it exactly the same way that you use the mutexes, 
  * but to handle the interactions between the processes within the simulation.   
- *
+ * 
+ * Don't mix simgrid synchronization with Java native one, or it will deadlock!
  */
 public class Mutex {
        private long bind; // The C object -- don't touch it
@@ -29,9 +30,7 @@ public class Mutex {
        public native void acquire();
        public native void release();
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                org.simgrid.NativeLib.nativeInit();
index 0787db1..73b2523 100644 (file)
@@ -8,18 +8,11 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when there is an error within the C world of SimGrid. 
- * Refer to the string message for more info on what went wrong.
- */
+/** This exception is raised when there is an error within the C world of SimGrid. */
 public class NativeException extends MsgException {
        private static final long serialVersionUID = 1L;
 
-       /**
-        * Constructs an <code>NativeException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>NativeException</code> with a detail message. */
        public NativeException(String s) {
                super(s);
        }
index f408d16..42d1276 100644 (file)
@@ -47,9 +47,7 @@ public abstract class Process implements Runnable {
         * access to it. It is set automatically during the build of the object.
         */
        private long bind;
-       /**
-        * Indicates if the process is started
-        */
+       /** Indicates if the process is started */
        boolean started;
        /**
         * Even if this attribute is public you must never access to it.
@@ -66,8 +64,7 @@ public abstract class Process implements Runnable {
 
        /** Time at which the process should be created  */
        protected double startTime = 0;
-       /** Time at which th
-        * Kill time of the process
+       /** Time at which the process should be killed.
         * 
         * Set at creation, and used internally by SimGrid
         */
@@ -83,9 +80,7 @@ public abstract class Process implements Runnable {
        public Vector<String> args;
 
 
-       /**
-        * Default constructor
-        */
+       /**  Default constructor */
        protected Process() {
                this.id = nextProcessId++;
                this.name = null;
index 2e0f5ad..1c7e1e8 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef _SURF_MAXMIN_H
 #define _SURF_MAXMIN_H
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/misc.h"
 #include "xbt/asserts.h"
 #include "surf/datatypes.h"
index 5a78792..405f4e0 100644 (file)
@@ -13,7 +13,7 @@
 #include "xbt/graph.h"
 #include "xbt/misc.h"
 #include "xbt/config.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "surf/surf_routing.h"
 #include "surf/datatypes.h"
 #include "xbt/lib.h"
index ac1fd1b..56f80dc 100644 (file)
@@ -9,10 +9,12 @@
 
 #include <string>
 #include <unordered_map>
+#include <memory>
 #include <vector>
 
 #include <xbt/base.h>
 
+#include "src/xbt/memory_map.hpp"
 #include "src/mc/mc_forward.h"
 #include "src/mc/Type.hpp"
 #include "src/mc/Frame.hpp"
@@ -97,7 +99,10 @@ public:
     const char* name, const char* scope);
 };
 
-
+XBT_PRIVATE std::shared_ptr<ObjectInformation> createObjectInformation(
+  std::vector<simgrid::xbt::VmMap> const& maps, const char* name);
+XBT_PRIVATE void postProcessObjectInformation(
+  simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info);
 
 }
 }
index 74f6411..6bf24dc 100644 (file)
@@ -29,7 +29,6 @@
 #include <xbt/base.h>
 #include <xbt/mmalloc.h>
 
-#include "src/mc/mc_object_info.h"
 #include "src/mc/mc_unw.h"
 #include "src/mc/mc_snapshot.h"
 #include "src/mc/mc_ignore.h"
@@ -108,13 +107,17 @@ struct s_mc_memory_map_re {
 
 static char* get_lib_name(const char* pathname, struct s_mc_memory_map_re* res)
 {
-  const char* map_basename = xbt_basename((char*) pathname);
+  char* map_basename = xbt_basename(pathname);
 
   regmatch_t match;
-  if(regexec(&res->so_re, map_basename, 1, &match, 0))
+  if(regexec(&res->so_re, map_basename, 1, &match, 0)) {
+    free(map_basename);
     return nullptr;
+  }
 
   char* libname = strndup(map_basename, match.rm_so);
+  free(map_basename);
+  map_basename = nullptr;
 
   // Strip the version suffix:
   if(libname && !regexec(&res->version_re, libname, 1, &match, 0)) {
@@ -315,7 +318,7 @@ void Process::init_memory_map_info()
 
   const char* current_name = nullptr;
 
-  this->object_infos.resize(0);
+  this->object_infos.clear();
 
   for (size_t i=0; i < maps.size(); i++) {
     simgrid::xbt::VmMap const& reg = maps[i];
@@ -357,7 +360,7 @@ void Process::init_memory_map_info()
     }
 
     std::shared_ptr<simgrid::mc::ObjectInformation> info =
-      MC_find_object_info(this->memory_map_, pathname);
+      simgrid::mc::createObjectInformation(this->memory_map_, pathname);
     this->object_infos.push_back(info);
     if (is_executable)
       this->binary_info = info;
@@ -371,7 +374,7 @@ void Process::init_memory_map_info()
 
   // Resolve time (including accross differents objects):
   for (auto const& object_info : this->object_infos)
-    MC_post_process_object_info(this, object_info.get());
+    postProcessObjectInformation(this, object_info.get());
 
   xbt_assert(this->maestro_stack_start_, "Did not find maestro_stack_start");
   xbt_assert(this->maestro_stack_end_, "Did not find maestro_stack_end");
index 5788d9c..99b11bc 100644 (file)
@@ -15,6 +15,7 @@
 #include "src/mc/mc_private.h"
 #include "xbt/module.h"
 #include <xbt/mmalloc.h>
+#include <xbt/memory.hpp>
 #include "src/smpi/private.h"
 
 #include "src/xbt/mmalloc/mmprivate.h"
@@ -192,14 +193,19 @@ void find_object_address(
   std::vector<simgrid::xbt::VmMap> const& maps,
   simgrid::mc::ObjectInformation* result)
 {
-  char* file_name = xbt_strdup(result->file_name.c_str());
-  const char *name = xbt_basename(file_name);
+  char* name = xbt_basename(result->file_name.c_str());
+
   for (size_t i = 0; i < maps.size(); ++i) {
     simgrid::xbt::VmMap const& reg = maps[i];
-    if (maps[i].pathname.empty()
-        || strcmp(xbt_basename(maps[i].pathname.c_str()), name)) {
-      // Nothing to do
-    } else if ((reg.prot & PROT_WRITE)) {
+    if (maps[i].pathname.empty())
+      continue;
+    char* map_basename = xbt_basename(maps[i].pathname.c_str());
+    if (strcmp(name, map_basename) != 0) {
+      free(map_basename);
+      continue;
+    }
+    free(map_basename);
+    if ((reg.prot & PROT_WRITE)) {
       xbt_assert(!result->start_rw,
                  "Multiple read-write segments for %s, not supported",
                  maps[i].pathname.c_str());
@@ -239,7 +245,8 @@ void find_object_address(
 
   xbt_assert(result->start_rw);
   xbt_assert(result->start_exec);
-  free(file_name);
+
+  free(name);
 }
 
 /************************************* Take Snapshot ************************************/
@@ -515,8 +522,14 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
       continue;
 
     // If dot_output enabled, do not handle the corresponding file
-    if (dot_output !=  nullptr && strcmp(xbt_basename(link), _sg_mc_dot_output_file) == 0)
-      continue;
+    if (dot_output != nullptr) {
+      char* link_basename = xbt_basename(link);
+      if (strcmp(link_basename, _sg_mc_dot_output_file) == 0) {
+        free(link_basename);
+        continue;
+      }
+      free(link_basename);
+    }
 
     // This is probably a shared memory used by lttng-ust:
     if(strncmp("/dev/shm/ust-shm-tmp-", link, 21)==0)
index dc7736a..7942ae2 100644 (file)
@@ -25,7 +25,6 @@
 #include "src/mc/mc_private.h"
 #include "src/mc/mc_dwarf.hpp"
 
-#include "src/mc/mc_object_info.h"
 #include "src/mc/Process.hpp"
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Variable.hpp"
@@ -1093,6 +1092,7 @@ std::string to_hex(std::vector<char> const& data)
 }
 
 /** Base directories for external debug files */
+static
 const char* debug_paths[] = {
   "/usr/lib/debug/",
   "/usr/local/lib/debug/",
@@ -1307,8 +1307,11 @@ static void MC_post_process_types(simgrid::mc::ObjectInformation* info)
   }
 }
 
+namespace simgrid {
+namespace mc {
+
 /** \brief Finds informations about a given shared object/executable */
-std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
+std::shared_ptr<simgrid::mc::ObjectInformation> createObjectInformation(
   std::vector<simgrid::xbt::VmMap> const& maps, const char *name)
 {
   std::shared_ptr<simgrid::mc::ObjectInformation> result =
@@ -1326,7 +1329,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
 
 /*************************************************************************/
 
-void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info)
+void postProcessObjectInformation(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info)
 {
   for (auto& i : info->types) {
 
@@ -1355,6 +1358,9 @@ void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::Obj
   }
 }
 
+}
+}
+
 namespace simgrid {
 namespace dwarf {
 
diff --git a/src/mc/mc_object_info.h b/src/mc/mc_object_info.h
deleted file mode 100644 (file)
index da93084..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_MC_OBJECT_INFO_H
-#define SIMGRID_MC_OBJECT_INFO_H
-
-#include <vector>
-#include <memory>
-
-#include <xbt/base.h>
-
-#include "src/mc/mc_forward.hpp"
-#include "src/xbt/memory_map.hpp"
-
-XBT_PRIVATE std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
-  std::vector<simgrid::xbt::VmMap> const& maps, const char* name);
-XBT_PRIVATE  void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info);
-
-#endif
diff --git a/src/portable.h b/src/portable.h
deleted file mode 100644 (file)
index c3ece3f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* portable -- header loading to write portable code within SimGrid         */
-
-/* Copyright (c) 2004, 2016. The SimGrid Team. All rights reserved.         */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_PORTABLE_H
-#define SIMGRID_PORTABLE_H
-
-#include "simgrid_config.h"       /* what was compiled in? */
-#include "src/internal_config.h"  /* some information about the environment */
-
-#ifdef _WIN32
-# include <windows.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_SYSCTL_H
-# include <sys/sysctl.h>
-#endif
-
-/* File handling */
-#ifdef _WIN32
-  #ifdef S_IRGRP
-    #undef S_IRGRP
-  #endif
-  #define S_IRGRP 0
-#endif
-#endif                          /* SIMGRID_PORTABLE_H */
index d9757d6..1b7109c 100644 (file)
@@ -297,7 +297,9 @@ xbt_dynar_t SD_daxload(const char *filename)
   }
 
   if (!acyclic_graph_detail(result)){
-    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", xbt_basename(filename));
+    char* base = xbt_basename(filename);
+    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base);
+    free(base);
     xbt_dynar_foreach(result, cpt, file)
       SD_task_destroy(file);
     xbt_dynar_free_container(&result);
index 8e97333..423df63 100644 (file)
@@ -240,7 +240,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par, bool
   }
 
   if (result && !acyclic_graph_detail(result)) {
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", xbt_basename((char*)filename));
+    char* base = xbt_basename(filename);
+    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", base);
+    free(base);
     xbt_dynar_free(&result);
     result = NULL;
   }
index c84dc52..91857d8 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "xbt/function_types.h"
 #include "smx_private.h"
-#include "src/portable.h"           /* loads context system definitions */
+#include "src/internal_config.h"           /* loads context system definitions */
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
 #include "src/xbt_modinter.h"       /* prototype of os thread module's init/exit in XBT */
index b1bc093..87ea4dc 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/log.h"
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
index 2ef29f3..b48faf5 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/storage_interface.hpp"
index 8226352..1dcc754 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "surf_private.h"
 #include "surf_interface.hpp"
 #include "network_interface.hpp"
index 550eb9e..01c3f3e 100644 (file)
@@ -9,7 +9,7 @@
 /* This is partially inspirated from the OSSP ts (Test Suite Library)       */
 /* At some point we should use https://github.com/google/googletest instead */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include <stdio.h>
 
 #include "xbt/sysdep.h"         /* bvprintf */
index c2268fa..28c1165 100644 (file)
@@ -603,7 +603,7 @@ void xbt_dict_postexit(void)
 #ifdef SIMGRID_TEST
 #include "xbt.h"
 #include "xbt/ex.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
index f5050cc..9d3dca6 100644 (file)
@@ -45,7 +45,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "src/portable.h"           /* execinfo when available */
+#include "src/internal_config.h"           /* execinfo when available */
 #include "xbt/ex.h"
 #include "xbt/str.h"
 #include "xbt/synchro_core.h"
index 1a13c86..8701f99 100644 (file)
@@ -11,7 +11,7 @@
 #include <stdio.h>              /* snprintf */
 #include <stdlib.h>             /* snprintf */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 #include "src/xbt_modinter.h"
 
index 2528b8f..ec15500 100644 (file)
@@ -17,7 +17,7 @@
 #include <xbt/base.h>
 #include <xbt/misc.h>
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/xbt_os_thread.h"
 #include "xbt/mmalloc.h"
 #include "xbt/ex.h"
index b93ecad..a541362 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/portable.h"       /* execinfo when available */
+#include "src/internal_config.h"       /* execinfo when available */
 #include "xbt/synchro_core.h"   /* xbt_thread_self_name */
 #include "src/xbt/ex_interface.h"
 #include "xbt/sysdep.h"
index 8f25418..5ef77ba 100644 (file)
@@ -13,7 +13,7 @@
 #include "simgrid/simix.h"      /* SIMIX_host_self_get_name */
 #include "surf/surf.h"
 #include <stdio.h>
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 extern const char *xbt_log_priority_names[8];
 extern int xbt_log_no_loc;
index ec1bddf..61551df 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "simgrid/sg_config.h"
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include <stdio.h>
 #ifdef _WIN32
 #include <signal.h> /* To silence MSVC on abort() */
index be781e1..4cc64d2 100644 (file)
@@ -9,7 +9,11 @@
 #include "xbt/sysdep.h"
 #include "xbt/file.h"    /* this module */
 #include "xbt/log.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
 
 #ifndef _MSC_VER
 #include "libgen.h" /* POSIX dirname */
index d5d9739..b80fb31 100644 (file)
@@ -25,7 +25,8 @@
 #include <semaphore.h>
 #include <errno.h>
 
-#if defined(WIN32)
+#if defined(_WIN32)
+#include <windows.h>
 #elif defined(__MACH__) && defined(__APPLE__)
 #include <stdint.h>
 #include <sys/types.h>
@@ -37,7 +38,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/ex.h"
 #include "src/xbt/ex_interface.h"  /* We play crude games with exceptions */
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/xbt_os_time.h"       /* Portable time facilities */
 #include "xbt/xbt_os_thread.h"     /* This module */
 #include "src/xbt_modinter.h"      /* Initialization/finalization of this module */
index 14f928f..5c1e852 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
 #include "xbt/str.h"            /* headers of these functions */
index 83862c4..048984e 100644 (file)
@@ -14,7 +14,6 @@
 #include <mc/mc.h>
 
 #include "mc/datatypes.h"
-#include "src/mc/mc_object_info.h"
 #include "src/mc/mc_private.h"
 
 #include "src/mc/Process.hpp"
index fbe890e..f059b2c 100644 (file)
@@ -13,7 +13,6 @@
 #include <stdlib.h>
 
 #include "src/mc/mc_private.h"
-#include "src/mc/mc_object_info.h"
 
 #include "src/mc/Process.hpp"
 #include "src/mc/Type.hpp"
index 7aac810..e7033d9 100644 (file)
@@ -14,7 +14,6 @@ set(EXTRA_DIST
   src/include/surf/maxmin.h
   src/include/surf/surf.h
   src/msg/msg_private.h
-  src/portable.h
   src/simdag/dax.dtd
   src/simdag/dax_dtd.c
   src/simdag/dax_dtd.h
@@ -573,7 +572,6 @@ set(MC_SRC
   src/mc/mc_unw.h
   src/mc/mc_unw.cpp
   src/mc/mc_unw_vmread.cpp
-  src/mc/mc_object_info.h
   src/mc/mc_checkpoint.cpp
   src/mc/mc_snapshot.h
   src/mc/mc_snapshot.cpp
index 817f0fc..e632714 100644 (file)
@@ -8,6 +8,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid_config.h"       /* what was compiled in? */
+
 /* Non-standard header files */
 #define HAVE_EXECINFO_H @HAVE_EXECINFO_H@ /* <execinfo.h> */
 #define HAVE_FUTEX_H    @HAVE_FUTEX_H@ /* <linux/futex.h> */