diff options
| author | Roland McGrath <[email protected]> | 2009-01-22 03:08:46 -0800 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2009-01-22 03:08:46 -0800 |
| commit | 97b12d0e19be004bd623b5ebc2b0504620ed06cc (patch) | |
| tree | 87793c51c333d26cc65814254038afb85fb1ad2a | |
| parent | afdd51e683f37412c1ce4eb9dddacd5a924f98e4 (diff) | |
known-dwarf.awk: Handle DW_FOO_BAR_* sets better.
| -rw-r--r-- | config/ChangeLog | 4 | ||||
| -rw-r--r-- | config/known-dwarf.awk | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index 883e8939..02184719 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2009-01-22 Roland McGrath <[email protected]> + + * known-dwarf.awk: Handle DW_FOO_BAR_* sets better. + 2009-01-11 Roland McGrath <[email protected]> * known-dwarf.awk: New file. diff --git a/config/known-dwarf.awk b/config/known-dwarf.awk index 6e8af6d4..3089dd27 100644 --- a/config/known-dwarf.awk +++ b/config/known-dwarf.awk @@ -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$/) { |
