int register_id = simgrid::dwarf::dwarf_register_to_libunwind(
op->atom - DW_OP_breg0);
unw_word_t res;
- if (!context.cursor)
+ if (not context.cursor)
throw evaluation_error("Missing stack context");
unw_get_reg(context.cursor, register_id, &res);
stack.push(res + op->number);
* Warning: the CFA returned by libunwind (UNW_X86_64_RSP, etc.)
* is the SP of the *current* frame. */
- if (!context.cursor)
+ if (not context.cursor)
throw evaluation_error("Missint cursor");
// Get frame:
// Address from the base address of this ELF object.
// Push the address on the stack (base_address + argument).
case DW_OP_addr: {
- if (!context.object_info)
+ if (not context.object_info)
throw evaluation_error("No base address");
Dwarf_Off addr = (Dwarf_Off) (std::uintptr_t)
context.object_info->base_address() + op->number;
// and replace the top of the stack with the computed value
// (stack.top() += stack.before_top()).
- case DW_OP_plus:
- stack.push(stack.pop() + stack.pop());
+ case DW_OP_plus: {
+ intptr_t first = stack.pop();
+ intptr_t second = stack.pop();
+ stack.push(first + second);
break;
+ }
- case DW_OP_mul:
- stack.push(stack.pop() * stack.pop());
+ case DW_OP_mul: {
+ intptr_t first = stack.pop();
+ intptr_t second = stack.pop();
+ stack.push(first * second);
break;
+ }
case DW_OP_plus_uconst:
stack.top() += op->number;
break;
}
- case DW_OP_and:
- stack.push(stack.pop() & stack.pop());
+ case DW_OP_and: {
+ intptr_t first = stack.pop();
+ intptr_t second = stack.pop();
+ stack.push(first & second);
break;
+ }
- case DW_OP_or:
- stack.push(stack.pop() | stack.pop());
+ case DW_OP_or: {
+ intptr_t first = stack.pop();
+ intptr_t second = stack.pop();
+ stack.push(first | second);
break;
+ }
- case DW_OP_xor:
- stack.push(stack.pop() ^ stack.pop());
+ case DW_OP_xor: {
+ intptr_t first = stack.pop();
+ intptr_t second = stack.pop();
+ stack.push(first ^ second);
break;
+ }
case DW_OP_nop:
break;
case DW_OP_deref:
// Computed address:
- if (!context.address_space)
+ if (not context.address_space)
throw evaluation_error("Missing address space");
context.address_space->read_bytes(
&stack.top(), sizeof(uintptr_t), remote(stack.top()),