Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Initialize data members with class initializers, or initialization lists.
[simgrid.git] / src / mc / inspect / DwarfExpression.hpp
index 5891042..0f695ee 100644 (file)
@@ -16,7 +16,6 @@
 #include <elfutils/libdw.h>
 #include <libunwind.h>
 
-#include "src/mc/AddressSpace.hpp"
 #include "src/mc/inspect/mc_dwarf.hpp"
 #include "src/mc/mc_forward.hpp"
 
@@ -43,23 +42,12 @@ typedef std::vector<Dwarf_Op> DwarfExpression;
  *  the process memory, etc. All those informations are gathered in
  *  the evaluation context.
  */
-class ExpressionContext {
-public:
-  ExpressionContext()
-      : cursor(nullptr)
-      , frame_base(nullptr)
-      , address_space(nullptr)
-      , object_info(nullptr)
-      , process_index(simgrid::mc::ProcessIndexMissing)
-  {
-  }
+struct ExpressionContext {
   /** CPU state (registers) */
-  unw_cursor_t* cursor;
-  void* frame_base;
-  /** Address space used to read memory */
-  simgrid::mc::AddressSpace* address_space;
-  simgrid::mc::ObjectInformation* object_info;
-  int process_index;
+  unw_cursor_t* cursor                           = nullptr;
+  void* frame_base                               = nullptr;
+  const simgrid::mc::AddressSpace* address_space = nullptr; /** Address space used to read memory */
+  simgrid::mc::ObjectInformation* object_info    = nullptr;
 };
 
 /** When an error happens in the execution of a DWARF expression */
@@ -80,11 +68,9 @@ public:
 private:
   // Values of the stack (the top is stack_[size_ - 1]):
   uintptr_t stack_[max_size]{0};
-  size_t size_;
+  size_t size_ = 0;
 
 public:
-  ExpressionStack() : size_(0) {}
-
   // Access:
   std::size_t size() const { return size_; }
   bool empty() const { return size_ == 0; }