Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move mc_find_frame_base in mc_dwarf.c where it belongs
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 20 Feb 2014 10:56:22 +0000 (11:56 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 20 Feb 2014 10:56:22 +0000 (11:56 +0100)
src/mc/mc_dwarf.c
src/mc/mc_hash.c

index 6b79598..3107c9d 100644 (file)
@@ -247,6 +247,31 @@ static dw_location_t MC_dwarf_get_location_list(mc_object_info_t info, Dwarf_Die
   }
 }
 
+/** \brief Find the frame base of a given frame
+ *
+ *  \param ip         Instruction pointer
+ *  \param frame
+ *  \param unw_cursor
+ */
+void* mc_find_frame_base(void* ip, dw_frame_t frame, unw_cursor_t* unw_cursor) {
+  switch(frame->frame_base->type) {
+  case e_dw_loclist:
+  {
+    int loclist_cursor;
+    for(loclist_cursor=0; loclist_cursor < xbt_dynar_length(frame->frame_base->location.loclist); loclist_cursor++){
+      dw_location_entry_t entry = xbt_dynar_get_as(frame->frame_base->location.loclist, loclist_cursor, dw_location_entry_t);
+      if((ip >= entry->lowpc) && (ip < entry->highpc)){
+        return (void*) MC_dwarf_resolve_location(unw_cursor, entry->location, NULL);
+      }
+    }
+    return NULL;
+  }
+  // Not handled:
+  default:
+    return NULL;
+  }
+}
+
 /** \brief Get the location expression or location list from an attribute
  *
  *  Processes direct expressions as well as location lists.
index c46dc4a..4e8c536 100644 (file)
@@ -247,31 +247,6 @@ static void mc_hash_stack_frame(
   }
 }
 
-/** \brief Find the frame base of a given frame
- *
- *  \param ip         Instruction pointer
- *  \param frame
- *  \param unw_cursor
- */
-void* mc_find_frame_base(void* ip, dw_frame_t frame, unw_cursor_t* unw_cursor) {
-  switch(frame->frame_base->type) {
-  case e_dw_loclist:
-  {
-    int loclist_cursor;
-    for(loclist_cursor=0; loclist_cursor < xbt_dynar_length(frame->frame_base->location.loclist); loclist_cursor++){
-      dw_location_entry_t entry = xbt_dynar_get_as(frame->frame_base->location.loclist, loclist_cursor, dw_location_entry_t);
-      if((ip >= entry->lowpc) && (ip < entry->highpc)){
-        return (void*) MC_dwarf_resolve_location(unw_cursor, entry->location, NULL);
-      }
-    }
-    return NULL;
-  }
-  // Not handled:
-  default:
-    return NULL;
-  }
-}
-
 static void mc_hash_stack(mc_hash_t *hash, mc_snapshot_stack_t stack, mc_hashing_state* state) {
 
   unsigned cursor = 0;