Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add support for DW_TAG_unspecified_type (nullptr_t in C++11)
[simgrid.git] / src / xbt / mmalloc / mm_diff.c
index 76865c9..c681d8b 100644 (file)
@@ -1,6 +1,6 @@
 /* mm_diff - Memory snapshooting and comparison                             */
 
-/* Copyright (c) 2008-2013. The SimGrid Team.
+/* Copyright (c) 2008-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -781,6 +781,9 @@ static int compare_heap_area_with_type(struct s_mm_diff *state, void *real_area1
   void *addr_pointed1, *addr_pointed2;;
 
   switch(type->type){
+  case DW_TAG_unspecified_type:
+    return 1;
+
   case DW_TAG_base_type:
     if(type->name!=NULL && strcmp(type->name, "char") == 0){ /* String, hence random (arbitrary ?) size */
       if(real_area1 == real_area2)
@@ -809,12 +812,16 @@ static int compare_heap_area_with_type(struct s_mm_diff *state, void *real_area1
   case DW_TAG_array_type:
     subtype = xbt_dict_get_or_null(info->types, type->dw_type_id);
     switch(subtype->type){
+    case DW_TAG_unspecified_type:
+      return 1;
+
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
     case DW_TAG_pointer_type:
     case DW_TAG_reference_type:
     case DW_TAG_rvalue_reference_type:
     case DW_TAG_structure_type:
+    case DW_TAG_class_type:
     case DW_TAG_union_type:
       if(subtype->byte_size == 0){ /*declaration of the type, need the complete description */
           subtype = xbt_dict_get_or_null(other_info->types_by_name, subtype->name);
@@ -878,6 +885,7 @@ static int compare_heap_area_with_type(struct s_mm_diff *state, void *real_area1
     }
     break;
   case DW_TAG_structure_type:
+  case DW_TAG_class_type:
     if(type->byte_size == 0){ /*declaration of the structure, need the complete description */
       dw_type_t full_type = xbt_dict_get_or_null(info->types_by_name, type->name);
       if(full_type){
@@ -932,6 +940,7 @@ static char* get_offset_type(char* type_id, int offset, mc_object_info_t info, m
   }
   switch(type->type){
   case DW_TAG_structure_type :
+  case DW_TAG_class_type:
     if(type->byte_size == 0){ /*declaration of the structure, need the complete description */
       if(*switch_type == 0){
         dw_type_t full_type = xbt_dict_get_or_null(info->types_by_name, type->name);