tools/elf4rom/libs/dwarf-20071209/dwarfdump/at_list.awk
changeset 34 92d87f2e53c2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/elf4rom/libs/dwarf-20071209/dwarfdump/at_list.awk	Fri Jan 15 09:07:44 2010 +0000
@@ -0,0 +1,22 @@
+# print code to return attribute name from list of attrs in dwarf.h (the input)
+# In case of a duplicate value, accept the first as definitive.
+# dwarf2 had a couple ambiguities/mistakes in attribute spelling.
+BEGIN {
+	printf "static int list_of_attrs[] = {\n"
+	used_pref["0"] = "";
+}
+{
+	prefix = "DW_AT_"
+	prefix_len = length(prefix)
+	if ($1 == "#define" && substr($2,1,prefix_len) == prefix) {
+		if ( used_pref[ $3] != $3 )  {
+		   printf "\t%s,\n", $2
+		   used_pref [$3] = $3 ;
+	        }
+	}
+}
+END {
+	printf "\t0\n"		# last value
+	printf "};\n"
+}
+