1 /* Copyright (c) 2008-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "simgrid_config.h"
14 #include <sys/types.h>
16 #include "mc_forward.h"
17 #include "mc_memory_map.h"
22 MC_PROCESS_NO_FLAG = 0,
23 MC_PROCESS_SELF_FLAG = 1,
24 } e_mc_process_flags_t;
26 /** Representation of a process
29 e_mc_process_flags_t process_flags;
31 memory_map_t memory_map;
32 void *maestro_stack_start, *maestro_stack_end;
33 mc_object_info_t libsimgrid_info;
34 mc_object_info_t binary_info;
35 mc_object_info_t* object_infos;
36 size_t object_infos_size;
40 void MC_process_init(mc_process_t process, pid_t pid);
41 void MC_process_clear(mc_process_t process);
44 bool MC_process_is_self(mc_process_t process)
46 return process->process_flags & MC_PROCESS_SELF_FLAG;
49 /* Process memory access: */
51 /** Read data from a process memory
53 * @param process the process
54 * @param local local memory address (destination)
55 * @param remote target process memory address (source)
56 * @param len data size
58 void MC_process_read(mc_process_t process, void* local, const void* remote, size_t len);
60 /** Write data to a process memory
62 * @param process the process
63 * @param local local memory address (source)
64 * @param remote target process memory address (target)
65 * @param len data size
67 void MC_process_write(mc_process_t process, const void* local, void* remote, size_t len);
69 /* Functions, variables of the process: */
71 mc_object_info_t MC_process_find_object_info(mc_process_t process, void* ip);
72 dw_frame_t MC_process_find_function(mc_process_t process, void* ip);