]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
known-dwarf.awk: Handle DW_FOO_BAR_* sets better.
authorRoland McGrath <roland@redhat.com>
Thu, 22 Jan 2009 11:08:46 +0000 (03:08 -0800)
committerRoland McGrath <roland@redhat.com>
Thu, 22 Jan 2009 11:08:46 +0000 (03:08 -0800)
config/ChangeLog
config/known-dwarf.awk

index 883e893958362ed64d97315945d5643e8ae6400e..02184719ddf957bfa54f2f7f00bca28fc77fb99f 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-22  Roland McGrath  <roland@redhat.com>
+
+       * known-dwarf.awk: Handle DW_FOO_BAR_* sets better.
+
 2009-01-11  Roland McGrath  <roland@redhat.com>
 
        * known-dwarf.awk: New file.
index 6e8af6d4396315094acf994c2c650cce1c6764cc..3089dd27f0e30ce04342038be443ad47bb251d9b 100644 (file)
@@ -1,9 +1,17 @@
 #!/bin/awk -f
 
-$1 ~ /DW_([A-Z]+)_([^ ]+)/ {
-  match($1, /DW_([A-Z]+)_([^ ]+)/, fields);
-  set = fields[1];
-  elt = fields[2];
+$1 == "enum" { set = ""; next }
+
+set == "" && $1 ~ /DW_([A-Z_]+)_([^ ]+)/ {
+  set = $1;
+  sub(/^DW_/, "", set);
+  sub(/_[^[:upper:]_].*$/, "", set);
+  if (set ~ /LANG_.+/) set = "LANG";
+}
+
+$1 ~ /DW([_A-Z]+)_([^ ]+)/ {
+  match($1, ("DW_" set "_([^ ]+)"), fields);
+  elt = fields[1];
   if (set in DW)
     DW[set] = DW[set] "," elt;
   else
@@ -14,16 +22,18 @@ $1 ~ /DW_([A-Z]+)_([^ ]+)/ {
     comment[set, elt] = c;
   }
 }
+
 END {
   print "/* Generated by config/dwarf-known.awk from libdw.h contents.  */";
   n = asorti(DW, sets);
   for (i = 1; i <= n; ++i) {
     set = sets[i];
     if (what && what != set) continue;
-    print "\n#define ALL_KNOWN_DW_" set " \\";
     split(DW[set], elts, ",");
     m = asort(elts);
     lo = hi = "";
+    if (m == 0) continue;
+    print "\n#define ALL_KNOWN_DW_" set " \\";
     for (j = 1; j <= m; ++j) {
       elt = elts[j];
       if (elt ~ /(lo|low)_user$/) {