3 ## Copyright (C) 2012 Red Hat, Inc.
5 ## This file is part of elfutils.
7 ## This file is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 3 of the License, or
10 ## (at your option) any later version.
12 ## elfutils is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
20 $1 == "enum" { set = ""; next }
22 set == "" && $1 ~ /DW_([A-Z_]+)_([^ ]+)/ {
25 sub(/_[^[:upper:]_].*$/, "", set);
26 if (set ~ /LANG_.+/) set = "LANG";
29 $1 ~ /DW([_A-Z]+)_([^ ]+)/ {
30 match($1, ("DW_" set "_([^ ]+)"), fields);
33 DW[set] = DW[set] "," elt;
36 if ($NF == "*/" && $4 == "/*") {
38 for (i = 6; i < NF; ++i) c = c " " $i;
39 comment[set, elt] = c;
44 print "/* Generated by config/known-dwarf.awk from libdw/dwarf.h contents. */";
46 for (i = 1; i <= n; ++i) {
48 if (what && what != set) continue;
49 split(DW[set], elts, ",");
53 print "\n#define ALL_KNOWN_DW_" set " \\";
54 for (j = 1; j <= m; ++j) {
56 if (elt ~ /(lo|low)_user$/) {
60 if (elt ~ /(hi|high)_user$/) {
64 if (comment[set, elt])
65 print " ONE_KNOWN_DW_" set "_DESC (" elt ", DW_" set "_" elt \
66 ", \"" comment[set, elt] "\") \\";
68 print " ONE_KNOWN_DW_" set " (" elt ", DW_" set "_" elt ") \\";
70 print " /* End of DW_" set "_*. */";