new_var->type = strdup(current_variable->type_origin);
new_var->region= region_type;
- if(current_variable->address.location != NULL){
- new_var->address = (void*) MC_dwarf_resolve_location(&c, current_variable->address.location, frame_pointer_address);
+ /* if(current_variable->address!=NULL) {
+ new_var->address = current_variable->address;
+ } else */
+ if(current_variable->location != NULL){
+ new_var->address = (void*) MC_dwarf_resolve_location(&c, current_variable->location, frame_pointer_address);
}
xbt_dynar_push(variables, &new_var);
// If the variable is not in this object, skip it:
// We do not expect to find a pointer to something which is not reachable
// by the global variables.
- if((char*) current_var->address.address < (char*) object_info->start_rw
- || (char*) current_var->address.address > (char*) object_info->end_rw)
+ if((char*) current_var->address < (char*) object_info->start_rw
+ || (char*) current_var->address > (char*) object_info->end_rw)
continue;
- offset = (char *)current_var->address.address - (char *)object_info->start_rw;
+ offset = (char *)current_var->address - (char *)object_info->start_rw;
dw_type_t bvariable_type = xbt_dict_get_or_null(object_info->types, current_var->type_origin);
res = compare_areas_with_type((char *)r1->data + offset, (char *)r2->data + offset, object_info, other_object_info, bvariable_type, r1->size, region_type, start_data, 0);
}
MC_SET_RAW_MEM;
+ if(0) {
if(!initial_state_safety->initial_communications_pattern_done){
print_communications_pattern(initial_communications_pattern);
}else{
}
}
initial_state_safety->initial_communications_pattern_done = 1;
+ }
MC_UNSET_RAW_MEM;
/* Trash the current state, no longer needed */
variable->global = frame == NULL; // Can be override base on DW_AT_location
variable->name = xbt_strdup(MC_dwarf_attr_string(die, DW_AT_name));
variable->type_origin = MC_dwarf_at_type(die);
- variable->address.address = NULL;
int klass = MC_dwarf_form_get_class(dwarf_whatform(&attr_location));
switch (klass) {
Dwarf_Off offset = expr[0].number;
// TODO, Why is this different base on the object?
Dwarf_Off base = strcmp(info->file_name, xbt_binary_name) !=0 ? (Dwarf_Off) info->start_exec : 0;
- variable->address.address = (void*) (base + offset);
+ variable->address = (void*) (base + offset);
} else {
- variable->address.location = MC_dwarf_get_expression(expr, len);
+ variable->location = MC_dwarf_get_expression(expr, len);
}
break;
case MC_DW_CLASS_LOCLISTPTR:
case MC_DW_CLASS_CONSTANT:
// Reference to location list:
- variable->address.location = MC_dwarf_get_location_list(die, &attr_location);
+ variable->location = MC_dwarf_get_location_list(die, &attr_location);
break;
default:
xbt_die("Unexpected calss 0x%x (%i) list for location in <%p>%s",
xbt_free(v->name);
xbt_free(v->type_origin);
if(!v->global)
- dw_location_free(v->address.location);
+ dw_location_free(v->location);
xbt_free(v);
}
}
end = cursor - 1;
}else{
if(address){ /* global variable */
- if(var_test->address.address == address)
+ if(var_test->address == address)
return -1;
- if(var_test->address.address > address)
+ if(var_test->address > address)
end = cursor - 1;
else
start = cursor + 1;
}
if(strcmp(var_test->name, var) == 0){
- if(address && var_test->address.address < address)
+ if(address && var_test->address < address)
return cursor+1;
else
return cursor;
}
void MC_dwarf_register_global_variable(mc_object_info_t info, dw_variable_t variable) {
- int index = MC_dwarf_get_variable_index(info->global_variables, variable->name, variable->address.address);
+ int index = MC_dwarf_get_variable_index(info->global_variables, variable->name, variable->address);
if (index != -1)
xbt_dynar_insert_at(info->global_variables, index, &variable);
// TODO, else ?
continue;
}
- const char* address = variable->address.address;
+ const char* address = variable->address;
bool valid_pointer = (address >= mc_binary_info->start_rw && address <= mc_binary_info->end_rw)
|| (address >= mc_libsimgrid_info->start_rw && address <= mc_libsimgrid_info->end_rw)
|| (address >= (const char*) std_heap && address < (const char *)std_heap + STD_HEAP_SIZE);
if(!valid_pointer) continue;
- mc_hash_value(hash, state, info, variable->address.address, type);
+ mc_hash_value(hash, state, info, variable->address, type);
}
}
XBT_DEBUG("Hash local variable %s without type", variable->name);
continue;
}
- if(variable->address.location == NULL) {
+ if(variable->location == NULL) {
XBT_DEBUG("Hash local variable %s without location", variable->name);
continue;
}
XBT_DEBUG("Hash local variable %s", variable->name);
- void* variable_address = (void*) MC_dwarf_resolve_location(unw_cursor, variable->address.location, frame_pointer);
+ void* variable_address = (void*) MC_dwarf_resolve_location(unw_cursor, variable->location, frame_pointer);
dw_type_t type = xbt_dict_get_or_null(info->types, variable->type_origin);
if(type==NULL) {
int global;
char *name;
char *type_origin;
- union{
- dw_location_t location; // For global==0
- void *address; // For global!=0
- }address;
+
+ // Use either of:
+ dw_location_t location;
+ void* address;
+
}s_dw_variable_t, *dw_variable_t;
typedef struct s_dw_frame{
switch(type->type){
case DW_TAG_base_type:
- if(strcmp(type->name, "char") == 0){ /* String, hence random (arbitrary ?) size */
+ if(type->name!=NULL && strcmp(type->name, "char") == 0){ /* String, hence random (arbitrary ?) size */
if(real_area1 == real_area2)
return -1;
else
type = type->subtype;
}
}
- if((type->byte_size == DW_TAG_pointer_type) || ((type->type == DW_TAG_base_type) && (!strcmp(type->name, "char"))))
+ if((type->byte_size == DW_TAG_pointer_type) || ((type->type == DW_TAG_base_type) && type->name!=NULL && (!strcmp(type->name, "char"))))
type_size = -1;
else
type_size = type->byte_size;
}
if(type_size != -1){
- if(type_size != heapinfo1[block1].busy_block.busy_size && type_size != heapinfo2[block2].busy_block.busy_size && !strcmp(type->name, "s_smx_context")){
+ if(type_size != heapinfo1[block1].busy_block.busy_size && type_size != heapinfo2[block2].busy_block.busy_size && type->name!=NULL && !strcmp(type->name, "s_smx_context")){
if(match_pairs){
match_equals(previous);
xbt_dynar_free(&previous);