X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f43536687685f8e4ff5c43fa22e571750327e5ed..44d3f27862736e3b045abf68ad949bdac5a75f08:/tools/generate-dwarf-functions diff --git a/tools/generate-dwarf-functions b/tools/generate-dwarf-functions index addd60b281..6f503c2cb0 100755 --- a/tools/generate-dwarf-functions +++ b/tools/generate-dwarf-functions @@ -12,23 +12,32 @@ cat - > src/mc/mc_dwarf_tagnames.cpp < +#include #include +namespace simgrid { +namespace dwarf { + /** \brief Get the name of a dwarf tag (DW_TAG_*) from its code * * \param tag tag code (see the DWARF specification) * \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";/') + case DW_TAG_invalid: + return "DW_TAG_invalid"; default: return "DW_TAG_unknown"; } } + +} +} EOF cat - > src/mc/mc_dwarf_attrnames.cpp << EOF @@ -40,15 +49,20 @@ cat - > src/mc/mc_dwarf_attrnames.cpp << EOF /* Warning: autogenerated, do not edit! */ -#include #include +#include + +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";/') @@ -56,4 +70,7 @@ $(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/ case \ return "DW_AT_unknown"; } } + +} +} EOF