static int compare_local_variables(mc_snapshot_t snapshot1,
mc_snapshot_t snapshot2,
mc_snapshot_stack_t stack1,
- mc_snapshot_stack_t stack2, void *heap1,
- void *heap2)
+ mc_snapshot_stack_t stack2)
{
if (!compared_pointers) {
compared_pointers =
} else {
unsigned int cursor = 0;
local_variable_t current_var1, current_var2;
- int offset1, offset2, res;
+ int res;
while (cursor < xbt_dynar_length(stack1->local_variables)) {
current_var1 =
(local_variable_t) xbt_dynar_get_as(stack1->local_variables, cursor,
current_var1->ip, current_var2->ip);
return 1;
}
- offset1 = (char *) current_var1->address - (char *) std_heap;
- offset2 = (char *) current_var2->address - (char *) std_heap;
// TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
-
dw_type_t subtype = current_var1->type;
res =
compare_areas_with_type(current_var1->address, snapshot1, mc_get_snapshot_region(current_var1->address, snapshot1),
// TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
XBT_VERB
("Local variable %s (%p - %p) in frame %s is different between snapshots",
- current_var1->name, (char *) heap1 + offset1,
- (char *) heap2 + offset2, current_var1->subprogram->name);
+ current_var1->name, current_var1->address, current_var2->address,
+ current_var1->subprogram->name);
xbt_dynar_free(&compared_pointers);
compared_pointers = NULL;
return res;
#endif
/* Init heap information used in heap comparison algorithm */
- res_init =
- init_heap_information((xbt_mheap_t) s1->regions[0]->data,
- (xbt_mheap_t) s2->regions[0]->data, s1->to_ignore,
- s2->to_ignore);
+ xbt_mheap_t heap1 = (xbt_mheap_t) mc_snapshot_read(std_heap, s1,
+ alloca(sizeof(struct mdesc)), sizeof(struct mdesc));
+ xbt_mheap_t heap2 = (xbt_mheap_t) mc_snapshot_read(std_heap, s2,
+ alloca(sizeof(struct mdesc)), sizeof(struct mdesc));
+ res_init = init_heap_information(heap1, heap2, s1->to_ignore, s2->to_ignore);
if (res_init == -1) {
#ifdef MC_DEBUG
XBT_DEBUG("(%d - %d) Different heap information", num1, num2);
(mc_snapshot_stack_t) xbt_dynar_get_as(s2->stacks, cursor,
mc_snapshot_stack_t);
diff_local =
- compare_local_variables(s1, s2, stack1, stack2, s1->regions[0]->data,
- s2->regions[0]->data);
+ compare_local_variables(s1, s2, stack1, stack2);
if (diff_local > 0) {
#ifdef MC_DEBUG
if (is_diff == 0) {
#endif
/* Compare heap */
- if (mmalloc_compare_heap(s1, s2, (xbt_mheap_t) s1->regions[0]->data,
- (xbt_mheap_t) s2->regions[0]->data) > 0) {
+ if (mmalloc_compare_heap(s1, s2) > 0) {
#ifdef MC_DEBUG
xbt_os_walltimer_stop(timer);