Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Hack to workaround weird/unexpected DWARF
[simgrid.git] / src / mc / mc_diff.cpp
index f1694c4..89b5b54 100644 (file)
@@ -1,16 +1,16 @@
-/* mc_diff - Memory snapshooting and comparison                             */
-
 /* Copyright (c) 2008-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+/* mc_diff - Memory snapshooting and comparison                             */
+
 #include "src/xbt/ex_interface.h"   /* internals of backtrace setup */
 #include "xbt/str.h"
 #include "mc/mc.h"
 #include "xbt/mmalloc.h"
-#include "mc_object_info.h"
+#include "src/mc/mc_object_info.h"
 #include "mc/datatypes.h"
 #include "src/mc/mc_private.h"
 #include "src/mc/mc_snapshot.h"
@@ -758,9 +758,13 @@ static int compare_heap_area_with_type(struct s_mc_diff *state, int process_inde
                                        int pointer_level)
 {
 top:
-  if (is_stack(real_area1) && is_stack(real_area2))
+  // HACK: This should not happen but in pratice, there is some
+  // DW_TAG_typedef without DW_AT_type. We should fix this somehow.
+  if (type == nullptr)
     return 0;
 
+  if (is_stack(real_area1) && is_stack(real_area2))
+    return 0;
   ssize_t ignore1, ignore2;
 
   if ((check_ignore > 0)
@@ -925,7 +929,7 @@ top:
         void *real_member2 = simgrid::dwarf::resolve_member(
             real_area2, type, &member, (simgrid::mc::AddressSpace*) snapshot2, process_index);
         res =
-            compare_heap_area_with_type(state, process_index, real_member1, real_member2,
+          compare_heap_area_with_type(state, process_index, real_member1, real_member2,
                                         snapshot1, snapshot2,
                                         previous, member.type, -1,
                                         check_ignore, 0);