#include "mc_object_info.h"
#include "mc_private.h"
+extern "C" {
+
static int mc_dwarf_push_value(mc_expression_state_t state, Dwarf_Off value)
{
if (state->stack_size >= MC_EXPRESSION_STACK_SIZE)
int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops,
mc_expression_state_t state)
{
- for (int i = 0; i != n; ++i) {
+ for (size_t i = 0; i != n; ++i) {
int error = 0;
const Dwarf_Op *op = ops + i;
uint8_t atom = op->atom;
// Address from the base address of this ELF object.
// Push the address on the stack (base_address + argument).
- case DW_OP_addr:
+ case DW_OP_addr: {
if (!state->object_info)
return MC_EXPRESSION_E_NO_BASE_ADDRESS;
if (state->stack_size == MC_EXPRESSION_STACK_SIZE)
MC_object_base_address(state->object_info) + op->number;
error = mc_dwarf_push_value(state, addr);
break;
+ }
// General constants:
// Push the constant argument on the stack.
expression->lowpc = NULL;
expression->highpc = NULL;
expression->size = len;
- expression->ops = xbt_malloc(len * sizeof(Dwarf_Op));
+ expression->ops = (Dwarf_Op*) xbt_malloc(len * sizeof(Dwarf_Op));
memcpy(expression->ops, ops, len * sizeof(Dwarf_Op));
}
}
}
+
+}