]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Generate macros for tables of known dwarf.h constants.
authorRoland McGrath <roland@redhat.com>
Sun, 11 Jan 2009 09:35:11 +0000 (01:35 -0800)
committerRoland McGrath <roland@redhat.com>
Sun, 11 Jan 2009 09:35:11 +0000 (01:35 -0800)
config/ChangeLog
config/Makefile.am
config/known-dwarf.awk [new file with mode: 0644]
libdw/ChangeLog
libdw/Makefile.am
libdw/dwarf.h

index 0c503736d05a09fd1e5033af9ed0c1ba4a2839e0..883e893958362ed64d97315945d5643e8ae6400e 100644 (file)
@@ -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.
index f2db4efb0c2ce0251a1e1942239978c85210c0b2..91adeee5c9bb73d27e3fc4fbbd9b6114f4b99627 100644 (file)
@@ -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 (file)
index 0000000..6e8af6d
--- /dev/null
@@ -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 "_*.  */";
+  }
+}
index cefb900b9dd737da454da0a1384093237e6821fc..9b9be90c724477384bfa53775fac27dc704e3843 100644 (file)
@@ -1,3 +1,11 @@
+2009-01-11  Roland McGrath  <roland@redhat.com>
+
+       * dwarf.h: Add description comments for DW_LANG_* values.
+
+       * Makefile.am [MAINTAINER_MODE]
+       ($(srcdir)/known-dwarf.h): New target.
+       (BUILT_SOURCES): Add it.
+
 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
 
        * dwarf_error.c: Always use __thread.  Remove all !USE_TLS code.
index 56c7a2ffebd24ef463e43d8d3ec4e2a4898f5044..6dda8eef9cba138a706ce51e658c6af3c90725e4 100644 (file)
@@ -85,6 +85,13 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
                  libdw_visit_scopes.c \
                  dwarf_entry_breakpoints.c
 
+if MAINTAINER_MODE
+BUILT_SOURCES = $(srcdir)/known-dwarf.h
+$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h
+       $(AWK) -f $^ > $@.new
+       mv -f $@.new $@
+endif
+
 if !MUDFLAP
 libdw_pic_a_SOURCES =
 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
index 091519c5664f2868560794ed1841236164156a6c..bdd16d9385f887db0dcbc1d03b15989c708403b4 100644 (file)
@@ -1,5 +1,5 @@
 /* This file defines standard DWARF types, structures, and macros.
-   Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008 Red Hat, Inc.
+   Copyright (C) 2000,2002,2005,2006,2007,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
@@ -515,25 +515,25 @@ enum
 /* DWARF language encodings.  */
 enum
   {
-    DW_LANG_C89 = 0x0001,
-    DW_LANG_C = 0x0002,
-    DW_LANG_Ada83 = 0x0003,
-    DW_LANG_C_plus_plus        = 0x0004,
-    DW_LANG_Cobol74 = 0x0005,
-    DW_LANG_Cobol85 = 0x0006,
-    DW_LANG_Fortran77 = 0x0007,
-    DW_LANG_Fortran90 = 0x0008,
-    DW_LANG_Pascal83 = 0x0009,
-    DW_LANG_Modula2 = 0x000a,
-    DW_LANG_Java = 0x000b,
-    DW_LANG_C99 = 0x000c,
-    DW_LANG_Ada95 = 0x000d,
-    DW_LANG_Fortran95 = 0x000e,
-    DW_LANG_PL1 = 0x000f,
-    DW_LANG_Objc = 0x0010,
-    DW_LANG_ObjC_plus_plus = 0x0011,
-    DW_LANG_UPC = 0x0012,
-    DW_LANG_D = 0x0013,
+    DW_LANG_C89 = 0x0001,           /* ISO C:1989 */
+    DW_LANG_C = 0x0002,                     /* C */
+    DW_LANG_Ada83 = 0x0003,         /* ISO Ada:1983 */
+    DW_LANG_C_plus_plus        = 0x0004,    /* ISO C++:1998 */
+    DW_LANG_Cobol74 = 0x0005,       /* ISO Cobol:1974 */
+    DW_LANG_Cobol85 = 0x0006,       /* ISO Cobol:1985 */
+    DW_LANG_Fortran77 = 0x0007,             /* ISO FORTRAN 77 */
+    DW_LANG_Fortran90 = 0x0008,             /* ISO Fortran 90 */
+    DW_LANG_Pascal83 = 0x0009,      /* ISO Pascal:1983 */
+    DW_LANG_Modula2 = 0x000a,       /* ISO Modula-2:1996 */
+    DW_LANG_Java = 0x000b,          /* Java */
+    DW_LANG_C99 = 0x000c,           /* ISO C:1999 */
+    DW_LANG_Ada95 = 0x000d,         /* ISO Ada:1995 */
+    DW_LANG_Fortran95 = 0x000e,             /* ISO Fortran 95 */
+    DW_LANG_PL1 = 0x000f,           /* ISO PL/1:1976 */
+    DW_LANG_Objc = 0x0010,          /* Objective-C */
+    DW_LANG_ObjC_plus_plus = 0x0011, /* Objective-C++ */
+    DW_LANG_UPC = 0x0012,           /* Unified Parallel C */
+    DW_LANG_D = 0x0013,                     /* D */
 
     DW_LANG_lo_user = 0x8000,
     DW_LANG_Mips_Assembler = 0x8001,