Exemple #1
0
/** Resolve a location expression */
Location resolve(
                      simgrid::dwarf::DwarfExpression const& expression,
                      simgrid::mc::ObjectInformation* object_info,
                      unw_cursor_t * c,
                      void *frame_pointer_address,
                      simgrid::mc::AddressSpace* address_space, int process_index)
{
  simgrid::dwarf::ExpressionContext context;
  context.frame_base = frame_pointer_address;
  context.cursor = c;
  context.address_space = address_space;
  context.object_info = object_info;
  context.process_index = process_index;

  if (!expression.empty()
      && expression[0].atom >= DW_OP_reg0
      && expression[0].atom <= DW_OP_reg31) {
    int dwarf_register = expression[0].atom - DW_OP_reg0;
    xbt_assert(c,
      "Missing frame context for register operation DW_OP_reg%i",
      dwarf_register);
    return Location(dwarf_register_to_libunwind(dwarf_register));
  }

  simgrid::dwarf::ExpressionStack stack;
  simgrid::dwarf::execute(expression, context, stack);
  return Location((void*) stack.top());
}
Exemple #2
0
 /** Whether the member is at a fixed offset from the base address */
 bool has_offset_location() const
 {
   // Recognize the expression `DW_OP_plus_uconst(offset)`:
   return location_expression.size() == 1 &&
     location_expression[0].atom == DW_OP_plus_uconst;
 }
inline
void execute(simgrid::dwarf::DwarfExpression const& expression,
  ExpressionContext const& context, ExpressionStack& stack)
{
  execute(expression.data(), expression.size(), context, stack);
}