Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update generator script to match the current code.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 May 2022 11:38:43 +0000 (13:38 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 May 2022 12:36:50 +0000 (14:36 +0200)
src/mc/inspect/mc_dwarf_attrnames.cpp
tools/generate-dwarf-functions

index b3eae04..037c6d2 100644 (file)
@@ -3,6 +3,8 @@
 /* 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. */
 
+/* Warning: autogenerated, do not edit! */
+
 #include "src/mc/inspect/mc_dwarf.hpp"
 
 #include <string>
index 959ba55..838d833 100755 (executable)
@@ -3,31 +3,29 @@
 # Usage: tools/generate-dwarf-functions /usr/include/dwarf.h
 
 HEADER="\
-/* Copyright (c) 2014-$(date +%Y). The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-$(date +%Y). 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. */
 
 /* Warning: autogenerated, do not edit! */
 
-#include <string>
-#include <unordered_map>
+#include \"src/mc/inspect/mc_dwarf.hpp\"
 
-#include \"src/mc/mc_dwarf.hpp\""
+#include <string>
+#include <unordered_map>"
 
-cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
+cat - > src/mc/inspect/mc_dwarf_tagnames.cpp <<EOF
 $HEADER
 
 namespace {
 const std::unordered_map<int, const char*> tagname_map = {
     {0x00, "DW_TAG_invalid"},
-$(grep DW_TAG_ -- "$1" | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/')
+$(sed -n 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/p' -- "$1")
 };
 }
 
-namespace simgrid {
-namespace dwarf {
+namespace simgrid::dwarf {
 
 /** @brief Get the name of a dwarf tag (DW_TAG_*) from its code
  *
@@ -35,27 +33,25 @@ namespace dwarf {
  *  @return name of the tag
  */
 XBT_PRIVATE
-const char *tagname(int tag)
+const chartagname(int tag)
 {
   auto name = tagname_map.find(tag);
   return name == tagname_map.end() ? "DW_TAG_unknown" : name->second;
 }
 
-}
-}
+} // namespace simgrid::dwarf
 EOF
 
-cat - > src/mc/mc_dwarf_attrnames.cpp << EOF
+cat - > src/mc/inspect/mc_dwarf_attrnames.cpp << EOF
 $HEADER
 
 namespace {
 const std::unordered_map<int, const char*> attrname_map = {
-$(grep DW_AT_ -- "$1" | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/')
+$(sed -n 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/    {\2, "\1"},/p' -- "$1")
 };
 }
 
-namespace simgrid {
-namespace dwarf  {
+namespace simgrid::dwarf {
 
 /** @brief Get the name of an attribute (DW_AT_*) from its code
  *
@@ -63,12 +59,11 @@ namespace dwarf  {
  *  @return name of the attribute
  */
 XBT_PRIVATE
-const char *attrname(int attr)
+const charattrname(int attr)
 {
   auto name = attrname_map.find(attr);
   return name == attrname_map.end() ? "DW_AT_unknown" : name->second;
 }
 
-}
-}
+} // namespace simgrid::dwarf
 EOF