- frame_found = 0;
- cursor = 0;
-
- //XBT_INFO("Frame %s", frame->name);
-
- 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_INFO("Variable : %s - value : %lx", current_variable->name, xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.res);
- 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(*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) == NULL){
- //XBT_INFO("Variable : %s - address : NULL", current_variable->name);
- 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_INFO("Variable : %s - value : %zd", current_variable->name, (size_t)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address));
- xbt_strbuff_append(variables, bprintf("%s=%zd\n", current_variable->name, (size_t)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address)));
- }else{
- //XBT_INFO("Variable : %s - address : %p", current_variable->name, *((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address));
- 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_INFO("Variable %s undefined", current_variable->name);
- xbt_strbuff_append(variables, bprintf("%s=undefined\n", current_variable->name));
- }
- break;
- default :
- break;
- }
- }else{
- //XBT_INFO("Variable : %s, no location", current_variable->name);
- xbt_strbuff_append(variables, bprintf("%s=undefined\n", current_variable->name));
- }
- }
-
- ret = unw_step(&c);