X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9122d33957bd260d3d5296bc250674d9a4eb4d40..7ef55d47978f2f2ef20bd27c85881faa99147034:/src/mc/mc_dwarf.c?ds=sidebyside diff --git a/src/mc/mc_dwarf.c b/src/mc/mc_dwarf.c index 3107c9d7ba..618ed29097 100644 --- a/src/mc/mc_dwarf.c +++ b/src/mc/mc_dwarf.c @@ -139,6 +139,7 @@ static int MC_dwarf_form_get_class(int form) { case DW_FORM_block: case DW_FORM_block1: return MC_DW_CLASS_BLOCK; + case DW_FORM_data1: case DW_FORM_data2: case DW_FORM_data4: case DW_FORM_data8: @@ -301,6 +302,7 @@ static dw_location_t MC_dwarf_get_location(mc_object_info_t info, Dwarf_Die* die // The attribute is a reference to a location list entry: case DW_FORM_sec_offset: + case DW_FORM_data1: case DW_FORM_data2: case DW_FORM_data4: case DW_FORM_data8: @@ -506,7 +508,8 @@ static void MC_dwarf_fill_member_location(dw_type_t type, dw_type_t member, Dwar Dwarf_Attribute attr; dwarf_attr_integrate(child, DW_AT_data_member_location, &attr); - int klass = MC_dwarf_form_get_class(dwarf_whatform(&attr)); + int form = dwarf_whatform(&attr); + int klass = MC_dwarf_form_get_class(form); switch (klass) { case MC_DW_CLASS_EXPRLOC: case MC_DW_CLASS_BLOCK: @@ -546,7 +549,9 @@ static void MC_dwarf_fill_member_location(dw_type_t type, dw_type_t member, Dwar // It's supposed to be possible in DWARF2 but I couldn't find its semantic // in the spec. default: - xbt_die("Can't handle form class 0x%x (%i) as DW_AT_member_location", klass, klass); + xbt_die( + "Can't handle form class (%i) / form 0x%x as DW_AT_member_location", + klass, form); } } @@ -845,7 +850,8 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D variable->name = xbt_strdup(MC_dwarf_attr_string(die, DW_AT_name)); variable->type_origin = MC_dwarf_at_type(die); - int klass = MC_dwarf_form_get_class(dwarf_whatform(&attr_location)); + int form = dwarf_whatform(&attr_location); + int klass = form == DW_FORM_sec_offset ? MC_DW_CLASS_CONSTANT : MC_dwarf_form_get_class(form); switch (klass) { case MC_DW_CLASS_EXPRLOC: case MC_DW_CLASS_BLOCK: @@ -877,8 +883,8 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D variable->location = MC_dwarf_get_location_list(info, die, &attr_location); break; default: - xbt_die("Unexpected calss 0x%x (%i) list for location in <%p>%s", - klass, klass, (void*) variable->dwarf_offset, variable->name); + xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%p>%s", + form, form, klass, klass, (void*) variable->dwarf_offset, variable->name); } // The current code needs a variable name, @@ -992,14 +998,6 @@ void MC_dwarf_get_variables(mc_object_info_t info) { Dwarf_Die die; if(dwarf_offdie(dwarf, offset+length, &die)!=NULL) { - - // Skip C++ for now (we will add support for it soon): - int lang = dwarf_srclang(&die); - if((lang==DW_LANG_C_plus_plus) || (lang==DW_LANG_ObjC_plus_plus)) { - offset = next_offset; - continue; - } - MC_dwarf_handle_die(info, &die, &die, NULL); } offset = next_offset;