X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bbe4982c906909c5740a69715b80174c2b800078..351f33cd435ca4f01717f0b8a4fe7a77ba16edbf:/src/mc/DwarfExpression.hpp diff --git a/src/mc/DwarfExpression.hpp b/src/mc/DwarfExpression.hpp index 4b1f202f26..b6713b22af 100644 --- a/src/mc/DwarfExpression.hpp +++ b/src/mc/DwarfExpression.hpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -15,9 +14,11 @@ #include #include +#include -#include "src/mc/mc_forward.hpp" #include "src/mc/AddressSpace.hpp" +#include "src/mc/mc_dwarf.hpp" +#include "src/mc/mc_forward.hpp" /** @file DwarfExpression.hpp * @@ -42,7 +43,8 @@ typedef std::vector DwarfExpression; * the process memory, etc. All those informations are gathered in * the evaluation context. */ -struct ExpressionContext { +class ExpressionContext { +public: ExpressionContext() : cursor(nullptr), frame_base(nullptr), address_space(nullptr), object_info(nullptr), process_index(simgrid::mc::ProcessIndexMissing) {} @@ -56,10 +58,9 @@ struct ExpressionContext { }; /** When an error happens in the execution of a DWARF expression */ -class evaluation_error : std::runtime_error { +class evaluation_error : public std::runtime_error { public: - evaluation_error(const char* what): std::runtime_error(what) {} - ~evaluation_error() noexcept(true); + explicit evaluation_error(const char* what) : std::runtime_error(what) {} }; /** A stack for evaluating a DWARF expression @@ -72,7 +73,7 @@ public: static const std::size_t max_size = 64; private: // Values of the stack (the top is stack_[size_ - 1]): - uintptr_t stack_[max_size]; + uintptr_t stack_[max_size] {0}; size_t size_; public: ExpressionStack() : size_(0) {}