Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Flag global variables in mc_ignore as belonging to the MCer
[simgrid.git] / src / mc / mc_process.h
index 05ba9b0..1e4384d 100644 (file)
@@ -8,6 +8,7 @@
 #define MC_PROCESS_H
 
 #include <stdbool.h>
+#include <sys/types.h>
 
 #include "simgrid_config.h"
 
@@ -25,6 +26,8 @@
 
 SG_BEGIN_DECL()
 
+int MC_process_vm_open(pid_t pid, int flags);
+
 typedef enum {
   MC_PROCESS_NO_FLAG = 0,
   MC_PROCESS_SELF_FLAG = 1,
@@ -43,6 +46,9 @@ struct s_mc_process {
   s_mc_address_space_t address_space;
   e_mc_process_flags_t process_flags;
   pid_t pid;
+  int socket;
+  int status;
+  bool running;
   memory_map_t memory_map;
   void *maestro_stack_start, *maestro_stack_end;
   mc_object_info_t libsimgrid_info;
@@ -75,9 +81,34 @@ struct s_mc_process {
    *  use `MC_process_get_malloc_info` in order to use it.
    */
   malloc_info* heap_info;
+
+  // ***** Libunwind-data
+
+  /** Full-featured MC-aware libunwind address space for the process
+   *
+   *  This address space is using a mc_unw_context_t
+   *  (with mc_process_t/mc_address_space_t and unw_context_t).
+   */
+  unw_addr_space_t unw_addr_space;
+
+  /** Underlying libunwind addres-space
+   *
+   *  The `find_proc_info`, `put_unwind_info`, `get_dyn_info_list_addr`
+   *  operations of the native MC address space is currently delegated
+   *  to this address space (either the local or a ptrace unwinder).
+   */
+  unw_addr_space_t unw_underlying_addr_space;
+
+  /** The corresponding context
+   */
+  void* unw_underlying_context;
+
+  xbt_dynar_t checkpoint_ignore;
 };
 
-void MC_process_init(mc_process_t process, pid_t pid);
+bool MC_is_process(mc_address_space_t p);
+
+void MC_process_init(mc_process_t process, pid_t pid, int sockfd);
 void MC_process_clear(mc_process_t process);
 
 /** Refresh the information about the process
@@ -123,10 +154,15 @@ const void* MC_process_read(mc_process_t process,
  */
 void MC_process_write(mc_process_t process, const void* local, void* remote, size_t len);
 
+void MC_process_clear_memory(mc_process_t process, void* remote, size_t len);
+
 /* Functions, variables of the process: */
 
-mc_object_info_t MC_process_find_object_info(mc_process_t process, void* ip);
-dw_frame_t MC_process_find_function(mc_process_t process, void* ip);
+mc_object_info_t MC_process_find_object_info(mc_process_t process, const void* addr);
+mc_object_info_t MC_process_find_object_info_exec(mc_process_t process, const void* addr);
+mc_object_info_t MC_process_find_object_info_rw(mc_process_t process, const void* addr);
+
+dw_frame_t MC_process_find_function(mc_process_t process, const void* ip);
 
 static inline xbt_mheap_t MC_process_get_heap(mc_process_t process)
 {