Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check for boost-graph
[simgrid.git] / tools / generate-dwarf-functions
index 984287c..6f503c2 100755 (executable)
@@ -3,7 +3,7 @@
 # Usage: tools/generate-dwarf-functions /usr/include/dwarf.h
 
 cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,7 +15,9 @@ cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
 #include <elfutils/libdw.h>
 
 #include <xbt/base.h>
-#include "mc_object_info.h"
+
+namespace simgrid {
+namespace dwarf {
 
 /** \brief Get the name of a dwarf tag (DW_TAG_*) from its code
  *
@@ -23,7 +25,7 @@ cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
  *  \return name of the tag
  */
 XBT_PRIVATE
-const char *MC_dwarf_tagname(int tag)
+const char *tagname(int tag)
 {
   switch (tag) {
 $(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/  case \2: return "\1";/')
@@ -33,10 +35,13 @@ $(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/  case
     return "DW_TAG_unknown";
   }
 }
+
+}
+}
 EOF
 
 cat - > src/mc/mc_dwarf_attrnames.cpp << EOF
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -44,17 +49,20 @@ cat - > src/mc/mc_dwarf_attrnames.cpp << EOF
 
 /* Warning: autogenerated, do not edit! */
 
-#include <xbt/base.h>
 #include <dwarf.h>
 
-#include "mc_object_info.h"
+#include <xbt/base.h>
+
+namespace simgrid {
+namespace dwarf  {
 
 /** \brief Get the name of an attribute (DW_AT_*) from its code
  *
  *  \param attr attribute code (see the DWARF specification)
  *  \return name of the attribute
  */
-const char *MC_dwarf_attrname(int attr)
+XBT_PRIVATE
+const char *attrname(int attr)
 {
   switch (attr) {
 $(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/  case \2: return "\1";/')
@@ -62,4 +70,7 @@ $(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/  case \
     return "DW_AT_unknown";
   }
 }
+
+}
+}
 EOF