Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Hack to workaround weird/unexpected DWARF
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 10 Feb 2016 16:45:30 +0000 (17:45 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 11 Feb 2016 16:15:41 +0000 (17:15 +0100)
For some reason, there is some DW_TAG_typedef without DW_AT_type:

<1><538832>: Numéro d'abréviation : 111 (DW_TAG_typedef)
    <538833>   DW_AT_name        : (chaîne indirecte, décalage: 0x2292f3): gregset_t
    <538837>   DW_AT_decl_file   : 98
    <538838>   DW_AT_decl_line   : 37

src/mc/mc_diff.cpp

index 93fd254..89b5b54 100644 (file)
@@ -758,9 +758,13 @@ static int compare_heap_area_with_type(struct s_mc_diff *state, int process_inde
                                        int pointer_level)
 {
 top:
                                        int pointer_level)
 {
 top:
-  if (is_stack(real_area1) && is_stack(real_area2))
+  // HACK: This should not happen but in pratice, there is some
+  // DW_TAG_typedef without DW_AT_type. We should fix this somehow.
+  if (type == nullptr)
     return 0;
 
     return 0;
 
+  if (is_stack(real_area1) && is_stack(real_area2))
+    return 0;
   ssize_t ignore1, ignore2;
 
   if ((check_ignore > 0)
   ssize_t ignore1, ignore2;
 
   if ((check_ignore > 0)
@@ -925,7 +929,7 @@ top:
         void *real_member2 = simgrid::dwarf::resolve_member(
             real_area2, type, &member, (simgrid::mc::AddressSpace*) snapshot2, process_index);
         res =
         void *real_member2 = simgrid::dwarf::resolve_member(
             real_area2, type, &member, (simgrid::mc::AddressSpace*) snapshot2, process_index);
         res =
-            compare_heap_area_with_type(state, process_index, real_member1, real_member2,
+          compare_heap_area_with_type(state, process_index, real_member1, real_member2,
                                         snapshot1, snapshot2,
                                         previous, member.type, -1,
                                         check_ignore, 0);
                                         snapshot1, snapshot2,
                                         previous, member.type, -1,
                                         check_ignore, 0);