2 # Generate files from a given dwarf.h
4 cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
5 /* Copyright (c) 2014. The SimGrid Team.
6 * All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify it
9 * under the terms of the license (GNU LGPL) which comes with this package. */
11 /* Warning: autogenerated, do not edit! */
16 #include "mc_object_info.h"
18 /** \brief Get the name of a dwarf tag (DW_TAG_*) from its code
20 * \param tag tag code (see the DWARF specification)
21 * \return name of the tag
24 const char *MC_dwarf_tagname(int tag)
27 $(cat "$1" | grep DW_TAG_ | sed 's/.*\(DW_TAG_[^ ]*\) = \(0x[0-9a-f]*\).*/ case \2: return "\1";/')
29 return "DW_TAG_invalid";
31 return "DW_TAG_unknown";
36 cat - > src/mc/mc_dwarf_attrnames.cpp << EOF
37 /* Copyright (c) 2014. The SimGrid Team.
38 * All rights reserved. */
40 /* This program is free software; you can redistribute it and/or modify it
41 * under the terms of the license (GNU LGPL) which comes with this package. */
43 /* Warning: autogenerated, do not edit! */
48 #include "mc_object_info.h"
50 /** \brief Get the name of an attribute (DW_AT_*) from its code
52 * \param attr attribute code (see the DWARF specification)
53 * \return name of the attribute
55 const char *MC_dwarf_attrname(int attr)
58 $(cat "$1" | grep DW_AT_ | sed 's/.*\(DW_AT_[^ ]*\) = \(0x[0-9a-f]*\).*/ case \2: return "\1";/')
60 return "DW_AT_unknown";