summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog5
-rw-r--r--config/Makefile.am4
-rw-r--r--config/known-dwarf.awk45
3 files changed, 52 insertions, 2 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 0c503736..883e8939 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Roland McGrath <roland@redhat.com>
+
+ * known-dwarf.awk: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2008-12-24 Roland McGrath <roland@redhat.com>
* Makefile.am ($(srcdir)/elfutils.spec.in): Rewrite awk magic.
diff --git a/config/Makefile.am b/config/Makefile.am
index f2db4efb..91adeee5 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
## Configure input file for elfutils.
##
-## Copyright (C) 2004, 2005, 2008 Red Hat, Inc.
+## Copyright (C) 2004, 2005, 2008, 2009 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
## Network licensing program, please visit www.openinventionnetwork.com
## <http://www.openinventionnetwork.com>.
##
-EXTRA_DIST = elfutils.spec.in
+EXTRA_DIST = elfutils.spec.in known-dwarf.awk
if MAINTAINER_MODE
$(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS
diff --git a/config/known-dwarf.awk b/config/known-dwarf.awk
new file mode 100644
index 00000000..6e8af6d4
--- /dev/null
+++ b/config/known-dwarf.awk
@@ -0,0 +1,45 @@
+#!/bin/awk -f
+
+$1 ~ /DW_([A-Z]+)_([^ ]+)/ {
+ match($1, /DW_([A-Z]+)_([^ ]+)/, fields);
+ set = fields[1];
+ elt = fields[2];
+ if (set in DW)
+ DW[set] = DW[set] "," elt;
+ else
+ DW[set] = elt;
+ if ($NF == "*/" && $4 == "/*") {
+ c = $5;
+ for (i = 6; i < NF; ++i) c = c " " $i;
+ 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 = "";
+ for (j = 1; j <= m; ++j) {
+ elt = elts[j];
+ if (elt ~ /(lo|low)_user$/) {
+ lo = elt;
+ continue;
+ }
+ if (elt ~ /(hi|high)_user$/) {
+ hi = elt;
+ continue;
+ }
+ if (comment[set, elt])
+ print " ONE_KNOWN_DW_" set "_DESC (" elt ", DW_" set "_" elt \
+ ", \"" comment[set, elt] "\") \\";
+ else
+ print " ONE_KNOWN_DW_" set " (" elt ", DW_" set "_" elt ") \\";
+ }
+ print " /* End of DW_" set "_*. */";
+ }
+}