*/
// We need this for the register indices:
-#define _GNU_SOURCE
+// #define _GNU_SOURCE
#include <string.h>
#include "mc_process.h"
#include "mc_unw.h"
+extern "C" {
+
// ***** Implementation
/** Get frame unwind information (libunwind method)
{
mc_unw_context_t context = (mc_unw_context_t) arg;
if (write)
- return -UNW_EREADONLYREG;
+ return - UNW_EREADONLYREG;
MC_address_space_read(context->address_space,
- 0, valp, (void*) addr, sizeof(unw_word_t), MC_PROCESS_INDEX_ANY);
+ MC_ADDRESS_SPACE_READ_FLAGS_NONE, valp, (void*) addr, sizeof(unw_word_t), MC_PROCESS_INDEX_ANY);
// We don't handle failure gracefully.
return 0;
}
unw_context_t* context = &as_context->context;
if (write)
return -UNW_EREADONLYREG;
- greg_t* preg = get_reg(context, regnum);
+ greg_t* preg = (greg_t*) get_reg(context, regnum);
if (!preg)
return -UNW_EBADREG;
*valp = *preg;
return unw_init_remote(cursor, context->process->unw_addr_space, context);
}
+
+}