From: Roland McGrath Date: Sun, 11 Jan 2009 09:35:11 +0000 (-0800) Subject: Generate macros for tables of known dwarf.h constants. X-Git-Tag: elfutils-0.139~18^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5513e643d78785900e8e9f723844beb1fc03d537;p=thirdparty%2Felfutils.git Generate macros for tables of known dwarf.h constants. --- diff --git a/config/ChangeLog b/config/ChangeLog index 0c503736d..883e89395 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2009-01-11 Roland McGrath + + * known-dwarf.awk: New file. + * Makefile.am (EXTRA_DIST): Add it. + 2008-12-24 Roland McGrath * Makefile.am ($(srcdir)/elfutils.spec.in): Rewrite awk magic. diff --git a/config/Makefile.am b/config/Makefile.am index f2db4efb0..91adeee5c 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 ## . ## -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 000000000..6e8af6d43 --- /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 "_*. */"; + } +} diff --git a/libdw/ChangeLog b/libdw/ChangeLog index cefb900b9..9b9be90c7 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,11 @@ +2009-01-11 Roland McGrath + + * 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 * dwarf_error.c: Always use __thread. Remove all !USE_TLS code. diff --git a/libdw/Makefile.am b/libdw/Makefile.am index 56c7a2ffe..6dda8eef9 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -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) diff --git a/libdw/dwarf.h b/libdw/dwarf.h index 091519c56..bdd16d938 100644 --- a/libdw/dwarf.h +++ b/libdw/dwarf.h @@ -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,