Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
afcbb70338966a1d34c3c23227a2f09775937b19
[simgrid.git] / src / mc / mc_memory_map.h
1 /* Copyright (c) 2007-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #ifndef MC_MEMORY_MAP_H
8 #define MC_MEMORY_MAP_H
9
10 #include <cstdint>
11
12 #include <string>
13 #include <vector>
14
15 #include <sys/types.h>
16
17 #include <simgrid_config.h>
18 #include "mc_forward.h"
19
20 namespace simgrid {
21 namespace mc {
22
23 /** An virtual memory map entry from /proc/$pid/maps */
24 struct VmMap {
25   std::uint64_t start_addr, end_addr;
26   int prot;                     /* Memory protection */
27   int flags;                    /* Additional memory flags */
28   std::uint64_t offset;         /* Offset in the file/whatever */
29   char dev_major;               /* Major of the device */
30   char dev_minor;               /* Minor of the device */
31   unsigned long inode;          /* Inode in the device */
32   std::string pathname;         /* Path name of the mapped file */
33 };
34
35 std::vector<VmMap> get_memory_map(pid_t pid);
36
37 }
38 }
39
40 extern "C" {
41
42 XBT_INTERNAL void MC_find_object_address(
43   std::vector<simgrid::mc::VmMap> const& maps, mc_object_info_t result);
44
45 }
46
47 #endif