dw_variable_t var = MC_process_find_variable_by_name(process, name);
if (!var->address)
xbt_die("No simple location for this variable");
+ if (!var->type->full_type)
+ xbt_die("Partial type for %s, cannot check size", name);
+ if (var->type->full_type->byte_size != size)
+ xbt_die("Unexpected size for %s (expected %zi, was %zi)",
+ name, size, (size_t) var->type->full_type->byte_size);
MC_process_read(process, MC_PROCESS_NO_FLAG, target, var->address, size,
MC_PROCESS_INDEX_ANY);
}
{
e_adress_space_read_flags_t flags = MC_PROCESS_NO_FLAG;
int index = MC_PROCESS_INDEX_ANY;
- return MC_process_read(process, flags, local, remote, len, index);
+ MC_process_read(process, flags, local, remote, len, index);
+ return local;
+}
+
+const void* MC_process_read_dynar_element(mc_process_t process,
+ void* local, const void* remote_dynar, size_t i)
+{
+ s_xbt_dynar_t d;
+ MC_process_read_simple(process, &d, remote_dynar, sizeof(d));
+ MC_process_read_simple(process, local, xbt_dynar_get_ptr(&d, i), i);
+ return local;
}
void MC_process_write(mc_process_t process, const void* local, void* remote, size_t len)
}
}
+unsigned long MC_process_read_dynar_length(mc_process_t process, const void* remote_dynar)
+{
+ if (!remote_dynar)
+ return 0;
+ unsigned long res;
+ MC_process_read_simple(process, &res,
+ &((xbt_dynar_t)remote_dynar)->used, sizeof(res));
+ return res;
+}
+
static pthread_once_t zero_buffer_flag = PTHREAD_ONCE_INIT;
static const void* zero_buffer;
static const int zero_buffer_size = 10 * 4096;