Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright notices
[simgrid.git] / src / mc / mc_dwarf.cpp
index 2134b08..9283528 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2014. The SimGrid Team.
+/* Copyright (c) 2008-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc_process.h"
+
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing");
 
@@ -610,14 +614,11 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   Dwarf_Die * unit, simgrid::mc::Frame* frame,
   const char *ns)
 {
-
   simgrid::mc::Type type;
-  type.type = -1;
+  type.type = dwarf_tag(die);
   type.name = std::string();
   type.element_count = -1;
 
-  type.type = dwarf_tag(die);
-
   // Global Offset
   type.id = dwarf_dieoffset(die);
 
@@ -857,8 +858,10 @@ static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwar
     const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
     if(ns)
       frame.name  = std::string(ns) + "::" + name;
-    else
+    else if (name)
       frame.name = name;
+    else
+      frame.name.clear();
   }
 
   frame.abstract_origin_id =
@@ -1056,8 +1059,8 @@ static void MC_make_functions_index(simgrid::mc::ObjectInformation* info)
 
   // Sort the array by low_pc:
   std::sort(info->functions_index.begin(), info->functions_index.end(),
-        [](simgrid::mc::FunctionIndexEntry& a,
-          simgrid::mc::FunctionIndexEntry& b)
+        [](simgrid::mc::FunctionIndexEntry const& a,
+          simgrid::mc::FunctionIndexEntry const& b)
         {
           return a.low_pc < b.low_pc;
         });
@@ -1139,7 +1142,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::shared_ptr<simgrid::mc::ObjectInformation> result =
     std::make_shared<simgrid::mc::ObjectInformation>();
   if (executable)
-    result->flags |= MC_OBJECT_INFO_EXECUTABLE;
+    result->flags |= simgrid::mc::ObjectInformation::Executable;
   result->file_name = name;
   MC_find_object_address(maps, result.get());
   MC_dwarf_get_variables(result.get());