- xbt_dict_foreach(frame->variables, dict_cursor, variable_name, current_variable){
- if(current_variable->location != NULL){
- switch(current_variable->location->type){
- case e_dw_compose:
- xbt_dynar_reset(compose);
- cursor = 0;
- while(cursor < xbt_dynar_length(current_variable->location->location.compose)){
- location_entry = xbt_dynar_get_as(current_variable->location->location.compose, cursor, dw_location_t);
- switch(location_entry->type){
- case e_dw_register:
- unw_get_reg(&c, location_entry->location.reg, &res);
- add_value(&compose, "value", (long)res);
- break;
- case e_dw_bregister_op:
- unw_get_reg(&c, location_entry->location.breg_op.reg, &res);
- add_value(&compose, "address", (long)res + location_entry->location.breg_op.offset);
- break;
- case e_dw_fbregister_op:
- if(frame_pointer_address != NULL)
- add_value(&compose, "address", (long)((char *)frame_pointer_address + location_entry->location.fbreg_op));
- break;
- default:
- xbt_dynar_reset(compose);
- break;
- }
- cursor++;
- }
-
- if(xbt_dynar_length(compose) > 0){
- if(strcmp(xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->type, "value") == 0){
- xbt_strbuff_append(variables, bprintf("%s=%lx\n", current_variable->name, xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.res));
- }else{
- if((long)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address < 0 || *((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) == NULL){
- xbt_strbuff_append(variables, bprintf("%s=NULL\n", current_variable->name));
- }else if(((long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) > 0xffffffff) || ((long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) < (long)start_text_binary)){
- xbt_strbuff_append(variables, bprintf("%s=%d\n", current_variable->name, (int)(long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address)));
- }else{
- xbt_strbuff_append(variables, bprintf("%s=%p\n", current_variable->name, *((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address)));
- }
- }
- }else{
- xbt_strbuff_append(variables, bprintf("%s=undefined\n", current_variable->name));
- }
- break;
- default :
- break;
- }
- }else{
- xbt_strbuff_append(variables, bprintf("%s=undefined\n", current_variable->name));
+ xbt_dynar_foreach(frame->variables, cursor, current_variable){
+
+ if((long)ip > (long)mc_libsimgrid_info->start_text)
+ region_type = 1;
+ else
+ region_type = 2;
+
+ local_variable_t new_var = xbt_new0(s_local_variable_t, 1);
+ new_var->frame = xbt_strdup(frame_name);
+ new_var->ip = (unsigned long)ip;
+ new_var->name = xbt_strdup(current_variable->name);
+ new_var->type = strdup(current_variable->type_origin);
+ new_var->region= region_type;
+
+ if(current_variable->address.location != NULL){
+ new_var->address = MC_dwarf_resolve_location(&c, current_variable->address.location, frame_pointer_address);