1 /* Copyright (c) 2014-2019. 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
22 void* resolve_member(const void* base, simgrid::mc::Type* /*type*/, simgrid::mc::Member* member,
23 simgrid::mc::AddressSpace* address_space, int process_index)
25 ExpressionContext state;
26 state.frame_base = nullptr;
27 state.cursor = nullptr;
28 state.address_space = address_space;
29 state.process_index = process_index;
31 ExpressionStack stack;
32 stack.push((ExpressionStack::value_type) base);
33 simgrid::dwarf::execute(member->location_expression, state, stack);
34 return (void*) stack.top();