Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Access memory from another process
[simgrid.git] / src / mc / mc_member.c
index 1d33a11..b5ee069 100644 (file)
@@ -4,6 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "mc_object_info.h"
 #include "mc_private.h"
 
 /** Resolve snapshot in the process address space
@@ -15,7 +16,7 @@
  * @return Process address of the given member of the 'object' struct/class
  */
 void *mc_member_resolve(const void *base, dw_type_t type, dw_type_t member,
-                        mc_snapshot_t snapshot)
+                        mc_snapshot_t snapshot, int process_index)
 {
   if (!member->location.size) {
     return ((char *) base) + member->offset;
@@ -28,6 +29,7 @@ void *mc_member_resolve(const void *base, dw_type_t type, dw_type_t member,
   state.snapshot = snapshot;
   state.stack_size = 1;
   state.stack[0] = (uintptr_t) base;
+  state.process_index = process_index;
 
   if (mc_dwarf_execute_expression
       (member->location.size, member->location.ops, &state))
@@ -37,4 +39,3 @@ void *mc_member_resolve(const void *base, dw_type_t type, dw_type_t member,
   else
     return (void *) state.stack[state.stack_size - 1];
 }
-