Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce some overly verbose comments
[simgrid.git] / src / mc / Frame.hpp
1 /* Copyright (c) 2007-2015. 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_FRAME_HPP
8 #define SIMGRID_MC_FRAME_HPP
9
10 #include <string>
11 #include <cstdint>
12
13 #include <xbt/base.h>
14 #include <xbt/range.hpp>
15
16 #include "src/mc/mc_forward.h"
17 #include "src/mc/LocationList.hpp"
18 #include "src/mc/Variable.hpp"
19 #include "src/mc/Frame.hpp"
20
21 namespace simgrid {
22 namespace mc {
23
24 /** Debug information about a given function or scope within a function */
25 class Frame {
26 public:
27   Frame();
28
29   /** Kind of scope (DW_TAG_subprogram, DW_TAG_inlined_subroutine, etc.) */
30   int tag = DW_TAG_invalid;
31
32   /** Name of the function (if it is a function) */
33   std::string name;
34
35   /** Range of instruction addresses for which this scope is valid */
36   simgrid::xbt::Range<std::uint64_t> range;
37
38   simgrid::dwarf::LocationList frame_base_location;
39
40   /** List of the variables (sorted by name) */
41   std::vector<Variable> variables;
42
43   /* Unique identifier for this scope (in the object_info)
44    *
45    * This is the global DWARF offset of the DIE. */
46   unsigned long int id = 0;
47
48   std::vector<Frame> scopes;
49
50   /** Value of `DW_AT_abstract_origin`
51    *
52    *  For inlined subprograms, this is the ID of the
53    *  parent function.
54    */
55   unsigned long int abstract_origin_id = 0;
56
57   simgrid::mc::ObjectInformation* object_info = nullptr;
58
59   void* frame_base(unw_cursor_t& unw_cursor) const;
60   void remove_variable(char* name);
61 };
62
63 inline
64 Frame::Frame()
65 {
66   this->tag = 0;
67   this->range = {0, 0};
68   this->id = 0;
69   this->abstract_origin_id = 0;
70   this->object_info = nullptr;
71 }
72
73 }
74 }
75
76 #endif