A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NS3.25 is out now
[simgrid.git]
/
src
/
mc
/
DwarfExpression.hpp
diff --git
a/src/mc/DwarfExpression.hpp
b/src/mc/DwarfExpression.hpp
index
fda5c6a
..
4b1f202
100644
(file)
--- a/
src/mc/DwarfExpression.hpp
+++ b/
src/mc/DwarfExpression.hpp
@@
-9,13
+9,19
@@
#include <cstdint>
#include <cstdlib>
#include <cstdint>
#include <cstdlib>
-#include <stdexcept>
+#include <stdexcept> // runtime_error
+#include <utility>
+#include <vector>
+
+#include <elfutils/libdw.h>
+
+#include "src/mc/mc_forward.hpp"
#include "src/mc/AddressSpace.hpp"
#include "src/mc/AddressSpace.hpp"
-/** @file DwarfExession.hpp
+/** @file DwarfEx
pr
ession.hpp
*
*
- * Evaluation of DWARF location expressions
+ * Evaluation of DWARF location expressions
.
*/
namespace simgrid {
*/
namespace simgrid {
@@
-24,7
+30,7
@@
namespace dwarf {
/** A DWARF expression
*
* DWARF defines a simple stack-based VM for evaluating expressions
/** 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.
*/
* just a sequence of dwarf instructions. We currently directly use
* `Dwarf_Op` from `dwarf.h` for dwarf instructions.
*/
@@
-65,6
+71,7
@@
public:
typedef std::uintptr_t value_type;
static const std::size_t max_size = 64;
private:
typedef std::uintptr_t value_type;
static const std::size_t max_size = 64;
private:
+ // Values of the stack (the top is stack_[size_ - 1]):
uintptr_t stack_[max_size];
size_t size_;
public:
uintptr_t stack_[max_size];
size_t size_;
public:
@@
-97,7
+104,7
@@
public:
void push(value_type value)
{
if (size_ == max_size)
void push(value_type value)
{
if (size_ == max_size)
- throw evaluation_error("D
warf
stack overflow");
+ throw evaluation_error("D
WARF
stack overflow");
stack_[size_++] = value;
}
stack_[size_++] = value;
}
@@
-105,7
+112,7
@@
public:
value_type pop()
{
if (size_ == 0)
value_type pop()
{
if (size_ == 0)
- throw evaluation_error("
S
tack underflow");
+ throw evaluation_error("
DWARF s
tack underflow");
return stack_[--size_];
}
return stack_[--size_];
}