1 /* Copyright (c) 2014-2017. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #include "src/mc/Type.hpp"
8 #include "src/mc/mc_dwarf.hpp"
9 #include "src/mc/mc_private.hpp"
14 /** Resolve snapshot in the process address space
16 * @param object Process address of the struct/class
17 * @param type Type of the struct/class
18 * @param member Member description
19 * @param snapshot Snapshot (or nullptr)
20 * @return Process address of the given member of the 'object' struct/class
23 const void *base, simgrid::mc::Type* type, simgrid::mc::Member* member,
24 simgrid::mc::AddressSpace* address_space, int process_index)
26 ExpressionContext state;
27 state.frame_base = nullptr;
28 state.cursor = nullptr;
29 state.address_space = address_space;
30 state.process_index = process_index;
32 ExpressionStack stack;
33 stack.push((ExpressionStack::value_type) base);
34 simgrid::dwarf::execute(member->location_expression, state, stack);
35 return (void*) stack.top();