Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f2cae32cae86beba1a1aa3fa53a4d21605810f29
[simgrid.git] / src / mc / inspect / Variable.hpp
1 /* Copyright (c) 2007-2023. 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 SIMGRID_MC_VARIABLE_HPP
8 #define SIMGRID_MC_VARIABLE_HPP
9
10 #include <cstddef>
11
12 #include <string>
13
14 #include "src/mc/inspect/LocationList.hpp"
15 #include "src/mc/mc_forward.hpp"
16
17 namespace simgrid::mc {
18
19 /** A variable (global or local) in the model-checked program */
20 class Variable {
21 public:
22   Variable()       = default;
23   std::uint32_t id = 0;
24   bool global      = false;
25   std::string name;
26   unsigned type_id        = 0;
27   simgrid::mc::Type* type = nullptr;
28
29   /** Address of the variable (if it is fixed) */
30   void* address = nullptr;
31
32   /** Description of the location of the variable (if it's not fixed) */
33   simgrid::dwarf::LocationList location_list;
34
35   /** Offset of validity of the variable (DW_AT_start_scope)
36    *
37    *  This is an offset from the variable scope beginning. This variable
38    *  is only valid starting from this offset.
39    */
40   std::size_t start_scope = 0;
41
42   simgrid::mc::ObjectInformation* object_info = nullptr;
43 };
44
45 } // namespace simgrid::mc
46
47 #endif