1 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/mc/inspect/Type.hpp"
7 #include "src/mc/inspect/mc_dwarf.hpp"
8 #include "src/mc/mc_private.hpp"
13 /** Resolve snapshot in the process address space
15 * @param object Process address of the struct/class
16 * @param type Type of the struct/class
17 * @param member Member description
18 * @param snapshot Snapshot (or nullptr)
19 * @return Process address of the given member of the 'object' struct/class
21 void* resolve_member(const void* base, const simgrid::mc::Type* /*type*/, const simgrid::mc::Member* member,
22 const simgrid::mc::AddressSpace* address_space)
24 ExpressionContext state;
25 state.address_space = address_space;
27 ExpressionStack stack;
28 stack.push((ExpressionStack::value_type)base);
29 simgrid::dwarf::execute(member->location_expression, state, stack);
30 return (void*)stack.top();
34 } // namespace simgrid