-}
-
-static void mc_hash_object_globals(hash_type * hash, mc_hashing_state * state,
- mc_object_info_t info)
-{
- unsigned int cursor = 0;
- dw_variable_t variable;
- xbt_dynar_foreach(info->global_variables, cursor, variable) {
- XBT_DEBUG("Hash global variable %s", variable->name);
-
- if (variable->type_origin == NULL) {
- // Nothing
- continue;
- }
-
- mc_type_t type = variable->type;
- if (type == NULL) {
- // Nothing
- continue;
- }
-
- const char *address = variable->address;
- bool valid_pointer = (address >= binary_info->start_rw
- && address <= binary_info->end_rw)
- || (address >= libsimgrid_info->start_rw
- && address <= libsimgrid_info->end_rw)
- || (address >= (const char *) process->heap_address
- && address < (const char *) process->heap_address + STD_HEAP_SIZE);
- if (!valid_pointer)
- continue;
-
- mc_hash_value(hash, state, info, variable->address, type);
- }
-}
-
-static void mc_hash_stack_frame(mc_hash_t * hash,
- mc_object_info_t info,
- unw_cursor_t * unw_cursor, dw_frame_t frame,
- char *frame_pointer, mc_hashing_state * state)
-{
-
- // return; // TEMP
-
- unsigned int cursor = 0;
- dw_variable_t variable;
- xbt_dynar_foreach(frame->variables, cursor, variable) {
-
- if (variable->type_origin == NULL) {
- XBT_DEBUG("Hash local variable %s without type", variable->name);
- continue;
- }
- if (variable->locations.size == 0) {
- XBT_DEBUG("Hash local variable %s without location", variable->name);
- continue;
- }
-
- XBT_DEBUG("Hash local variable %s", variable->name);
-
- void *variable_address =
- (void *) mc_dwarf_resolve_locations(&variable->locations,
- variable->object_info, unw_cursor,
- frame_pointer, NULL);
-
- mc_type_t type = variable->type;
- if (type == NULL) {
- XBT_DEBUG("Hash local variable %s without loctypeation", variable->name);
- continue;
- }
-
- mc_hash_value(hash, state, info, variable_address, type);
- }
-
- // TODO, handle nested scopes
-}
-
-static void mc_hash_stack(mc_hash_t * hash, mc_snapshot_stack_t stack,
- mc_hashing_state * state)
-{
-
- unsigned cursor = 0;
- mc_stack_frame_t stack_frame;
-
- for(s_mc_stack_frame_t const& stack_frame : stack->stack_frames) {
-
- hash_update(*hash, stack_frame.ip);
-
- mc_object_info_t info;
- if (stack_frame.ip >= (unw_word_t) libsimgrid_info->start_exec
- && stack_frame.ip < (unw_word_t) libsimgrid_info->end_exec)
- info = libsimgrid_info;
- else if (stack_frame.ip >= (unw_word_t) binary_info->start_exec
- && stack_frame.ip < (unw_word_t) binary_info->end_exec)
- info = binary_info;
- else
- continue;
-
- mc_hash_stack_frame(hash, info, &(stack_frame.unw_cursor),
- stack_frame.frame, (void *) stack_frame.frame_base,
- state);
-
- }
-}
-
-static void mc_hash_stacks(mc_hash_t * hash, mc_hashing_state * state,
- xbt_dynar_t stacks)
-{
- unsigned int cursor = 0;
- mc_snapshot_stack_t current_stack;
-
- hash_update(*hash, xbt_dynar_length(stacks_areas));
-
- int i = 0;
- xbt_dynar_foreach(stacks, cursor, current_stack) {
- XBT_DEBUG("Stack %i", i);
- mc_hash_stack(hash, current_stack, state);
- ++i;
- }
-}
-#endif
-
-static hash_type hash(std::vector<s_mc_snapshot_stack_t> const& stacks)
-{
-#if 0
- mc_hashing_state state;
- mc_hash_state_init(&state);
-#endif
-
- hash_type hash = MC_HASH_INIT;
-
- hash_update(hash, xbt_swag_size(simix_global->process_list));
-#if 0
- // mc_hash_object_globals(&hash, &state, binary_info);
- // mc_hash_object_globals(&hash, &state, libsimgrid_info);
- // mc_hash_stacks(&hash, &state, stacks);
- mc_hash_state_destroy(&state);
-#endif
-