-/* Copyright (c) 2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2015-2017. 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. */
/** A DWARF expression
*
* DWARF defines a simple stack-based VM for evaluating expressions
- * (such as locations of variables, etc.): a DWARF expressions is
+ * (such as locations of variables, etc.): a DWARF expression is
* just a sequence of dwarf instructions. We currently directly use
* `Dwarf_Op` from `dwarf.h` for dwarf instructions.
*/
* 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) {}
class evaluation_error : std::runtime_error {
public:
evaluation_error(const char* what): std::runtime_error(what) {}
- ~evaluation_error() noexcept(true);
};
/** A stack for evaluating a DWARF expression
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) {}