Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Do not try to handle scopes inside a subprogram
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 24 Feb 2014 12:22:10 +0000 (13:22 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 24 Feb 2014 12:43:24 +0000 (13:43 +0100)
commitf580cea86d474771008f05d9dd6e2419a2e12de8
tree87745ffa325591533055524655825c6822a19e66
parentd2153a5d5e08ae057d587354db583072367f686e
[mc] Do not try to handle scopes inside a subprogram

The variables of a subprogram scopes were merged in the information
about subprogram without any information on its range of validity (for
which range of IP the variable is valid).

As this handling of scopes was broken, this commit ignore the scopes within a
subprogram.

We need to:

  * either add frame_t as child of frame_t to represent scope;

  * or attach validity information on each variables

    This one is needed anyway in order to handle DW_AT_start_scope.

  * or both.

    Use frame_t for DW_TAG_inlined_subprogram and validity range for
    real scope.

-    if(dwarf_offdie(dwarf, offset+length, &die)!=NULL) {
-      MC_dwarf_handle_die(info, &die, &die, NULL);
+    if(dwarf_offdie(dwarf, offset+length, &unit_die)!=NULL) {
+      Dwarf_Die child;
+      int res;
+      for (res=dwarf_child(&unit_die, &child); res==0; res=dwarf_siblingof(&child,&child)) {
+        MC_dwarf_handle_die(info, &child, &unit_die, NULL);
+      }
     }
     offset = next_offset;
   }
examples/msg/mc/bugged1_liveness_visited.tesh
src/mc/mc_dwarf.c