Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove mc_untranslate_address() and mc_member_snapshot_resolve()
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 17 Jun 2014 13:52:32 +0000 (15:52 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 17 Jun 2014 13:52:34 +0000 (15:52 +0200)
Those were working in the snapshot address space so we do not use them
anymore (it is not very useful to work in the snapshot space when the
snapshot space is broken in pages).

We work in the process address space instead (mc_member_resolve).

src/mc/mc_member.c
src/mc/mc_private.h
src/mc/mc_snapshot.c

index bc2436a..1d33a11 100644 (file)
@@ -38,26 +38,3 @@ void *mc_member_resolve(const void *base, dw_type_t type, dw_type_t member,
     return (void *) state.stack[state.stack_size - 1];
 }
 
-/** Resolve snapshot in the snapshot address space
- *
- * @param  object Snapshot address of the struct/class
- * @param  type Type of the struct/class
- * @param  member Member description
- * @param  snapshot Snapshot (or NULL)
- * @return Snapshot address of the given member of the 'object' struct/class
- */
-void *mc_member_snapshot_resolve(const void *object, dw_type_t type,
-                                 dw_type_t member, mc_snapshot_t snapshot)
-{
-  if (!member->location.size) {
-    return (char *) object + member->offset;
-  } else {
-    // Translate the problem in the process address space:
-    void *real_area =
-        (void *) mc_untranslate_address((void *) object, snapshot);
-    // Resolve the member in the process address space:
-    void *real_member = mc_member_resolve(real_area, type, member, snapshot);
-    // Translate back in the snapshot address space:
-    return mc_translate_address((uintptr_t) real_member, snapshot);
-  }
-}
index 9d07e71..1752d63 100644 (file)
@@ -200,18 +200,6 @@ void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region);
  * */
 void* mc_translate_address(uintptr_t addr, mc_snapshot_t snapshot);
 
-/** \brief Translate a pointer from the snapshot address space to the application address space
- *
- *  This is the inverse of mc_translate_address.
- *
- *  Does not work for per-page snapshot, we change the logic to handle this.
- *
- * \param addr    Address in the snapshot address space
- * \param snapsot Snapshot of interest (if NULL no translation is done)
- * \return        Translated address in the application address space
- */
-uintptr_t mc_untranslate_address(void* addr, mc_snapshot_t snapshot);
-
 extern xbt_dynar_t mc_checkpoint_ignore;
 
 /********************************* MC Global **********************************/
@@ -547,7 +535,6 @@ struct s_dw_type{
 };
 
 void* mc_member_resolve(const void* base, dw_type_t type, dw_type_t member, mc_snapshot_t snapshot);
-void* mc_member_snapshot_resolve(const void* base, dw_type_t type, dw_type_t member, mc_snapshot_t snapshot);
 
 typedef struct s_dw_variable{
   Dwarf_Off dwarf_offset; /* Global offset of the field. */
index 71b038e..79cfd78 100644 (file)
@@ -58,27 +58,6 @@ void* mc_translate_address(uintptr_t addr, mc_snapshot_t snapshot)
 
 }
 
-uintptr_t mc_untranslate_address(void *addr, mc_snapshot_t snapshot)
-{
-  if (!snapshot) {
-    return (uintptr_t) addr;
-  }
-
-  for (size_t i = 0; i != NB_REGIONS; ++i) {
-    mc_mem_region_t region = snapshot->regions[i];
-    if (region->page_numbers) {
-      xbt_die("Does not work for per-page snapshot.");
-    }
-    if (addr >= region->data
-        && addr <= (void *) (((char *) region->data) + region->size)) {
-      size_t offset = (size_t) ((char *) addr - (char *) region->data);
-      return ((uintptr_t) region->start_addr) + offset;
-    }
-  }
-
-  return (uintptr_t) addr;
-}
-
 /** @brief Read memory from a snapshot region broken across fragmented pages
  *
  *  @param addr    Process (non-snapshot) address of the data