summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2015-03-18 19:42:02 +0100
committerPetr Machata <pmachata@redhat.com>2015-03-31 19:01:40 +0200
commit7f617347794f7d57f69d08f38c00f3f6ad221a56 (patch)
tree0c72ce8e93adc854c7d8a3ed44446e0ef21af78c
parent5370bb0a6492cb4669c8375e53748a4303997ed7 (diff)
downloadelfutils-7f617347794f7d57f69d08f38c00f3f6ad221a56.tar.gz
Publish known-dwarf.h
- Make the macro names properly scoped (DWARF_ALL_KNOWN_* and DWARF_ONE_KNOWN_*). - Simplify the calling convention: don't keep track of the comment associated with the enumerator, always use the non-_DESC DWARF_ONE_KNOWN_* callback. - Install known-dwarf.h alongside libdw.h and others. Signed-off-by: Petr Machata <pmachata@redhat.com>
-rw-r--r--NEWS4
-rw-r--r--config/ChangeLog7
-rwxr-xr-xconfig/known-dwarf.awk13
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/Makefile.am4
-rw-r--r--src/ChangeLog11
-rw-r--r--src/readelf.c90
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/addrcfi.c10
-rw-r--r--tests/allregs.c8
-rw-r--r--tests/show-die-info.c14
-rw-r--r--tests/varlocs.c16
12 files changed, 104 insertions, 86 deletions
diff --git a/NEWS b/NEWS
index e4fd31e2..60aa995d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 0.162
+
+libdw: Install new header elfutils/known-dwarf.h.
+
Version 0.161
libdw: New function dwarf_peel_type. dwarf_aggregate_size now uses
diff --git a/config/ChangeLog b/config/ChangeLog
index 409e2b1b..586ebb03 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-18 Petr Machata <pmachata@redhat.com>
+
+ * known-dwarf.awk (comment): Drop all uses of this variable.
+ (END): Always emit the non-_DESC variant. Emit
+ DWARF_ALL_KNOWN_DW_ instead of ALL_KNOWN_DW_*, and
+ DWARF_ONE_KNOWN_DW_ instead of ONE_KNOWN_DW_*.
+
2015-02-20 Petr Machata <pmachata@redhat.com>
* known-dwarf.awk (END): Drop useless variables lo, hi. Merge two
diff --git a/config/known-dwarf.awk b/config/known-dwarf.awk
index 4d89f0f3..bc9b02db 100755
--- a/config/known-dwarf.awk
+++ b/config/known-dwarf.awk
@@ -33,11 +33,6 @@ $1 ~ /DW([_A-Z]+)_([^ ]+)/ {
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 {
@@ -49,16 +44,12 @@ END {
split(DW[set], elts, ",");
m = asort(elts);
if (m == 0) continue;
- print "\n#define ALL_KNOWN_DW_" set " \\";
+ print "\n#define DWARF_ALL_KNOWN_DW_" set " \\";
for (j = 1; j <= m; ++j) {
elt = elts[j];
if (elt ~ /(low?|hi|high)_user$/)
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 " DWARF_ONE_KNOWN_DW_" set " (" elt ", DW_" set "_" elt ") \\";
}
print " /* End of DW_" set "_*. */";
}
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 59fda1ae..3ca85cbe 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-18 Petr Machata <pmachata@redhat.com>
+
+ * Makefile.am (pkginclude_HEADERS): Add known-dwarf.h.
+ (EXTRA_DIST): Remove known-dwarf.h.
+
2015-02-09 Mark Wielaard <mjw@redhat.com>
* dwarf.h: Add DW_LANG_Fortran03 and DW_LANG_Fortran08.
diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 887da6b0..272289c4 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -39,7 +39,7 @@ noinst_LIBRARIES = libdw_pic.a
noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
include_HEADERS = dwarf.h
-pkginclude_HEADERS = libdw.h
+pkginclude_HEADERS = libdw.h known-dwarf.h
libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \
@@ -137,6 +137,6 @@ libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects))
noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
dwarf_sig8_hash.h cfi.h encoded-value.h
-EXTRA_DIST = libdw.map known-dwarf.h
+EXTRA_DIST = libdw.map
MOSTLYCLEANFILES = $(am_libdw_pic_a_OBJECTS) libdw.so.$(VERSION)
diff --git a/src/ChangeLog b/src/ChangeLog
index bb9580a8..858d0f7a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2015-03-18 Petr Machata <pmachata@redhat.com>
+
+ * readelf.c (dwarf_tag_string, dwarf_attr_string)
+ (dwarf_form_string, dwarf_lang_string, dwarf_inline_string)
+ (dwarf_encoding_string, dwarf_access_string)
+ (dwarf_visibility_string, dwarf_virtuality_string)
+ (dwarf_identifier_case_string, dwarf_calling_convention_string)
+ (dwarf_ordering_string, dwarf_discr_list_string)
+ (dwarf_locexpr_opcode_string): Adjust uses of know-dwarf.h macros
+ to match the API changes.
+
2015-03-09 Mark Wielaard <mjw@redhat.com>
* elflint.c (compare_hash_gnu_hash): Correct gnu_symbias usage.
diff --git a/src/readelf.c b/src/readelf.c
index 237975f9..23bd73f6 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -1,5 +1,5 @@
/* Print information from ELF file in human-readable form.
- Copyright (C) 1999-2014 Red Hat, Inc.
+ Copyright (C) 1999-2015 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1999.
@@ -3566,9 +3566,9 @@ dwarf_tag_string (unsigned int tag)
{
switch (tag)
{
-#define ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
- ALL_KNOWN_DW_TAG
-#undef ONE_KNOWN_DW_TAG
+#define DWARF_ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_TAG
+#undef DWARF_ONE_KNOWN_DW_TAG
default:
return NULL;
}
@@ -3580,9 +3580,9 @@ dwarf_attr_string (unsigned int attrnum)
{
switch (attrnum)
{
-#define ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME;
- ALL_KNOWN_DW_AT
-#undef ONE_KNOWN_DW_AT
+#define DWARF_ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_AT
+#undef DWARF_ONE_KNOWN_DW_AT
default:
return NULL;
}
@@ -3594,11 +3594,9 @@ dwarf_form_string (unsigned int form)
{
switch (form)
{
-#define ONE_KNOWN_DW_FORM_DESC(NAME, CODE, DESC) ONE_KNOWN_DW_FORM (NAME, CODE)
-#define ONE_KNOWN_DW_FORM(NAME, CODE) case CODE: return #NAME;
- ALL_KNOWN_DW_FORM
-#undef ONE_KNOWN_DW_FORM
-#undef ONE_KNOWN_DW_FORM_DESC
+#define DWARF_ONE_KNOWN_DW_FORM(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_FORM
+#undef DWARF_ONE_KNOWN_DW_FORM
default:
return NULL;
}
@@ -3610,9 +3608,9 @@ dwarf_lang_string (unsigned int lang)
{
switch (lang)
{
-#define ONE_KNOWN_DW_LANG_DESC(NAME, CODE, DESC) case CODE: return #NAME;
- ALL_KNOWN_DW_LANG
-#undef ONE_KNOWN_DW_LANG_DESC
+#define DWARF_ONE_KNOWN_DW_LANG(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_LANG
+#undef DWARF_ONE_KNOWN_DW_LANG
default:
return NULL;
}
@@ -3624,9 +3622,9 @@ dwarf_inline_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_INL(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_INL
-#undef ONE_KNOWN_DW_INL
+#define DWARF_ONE_KNOWN_DW_INL(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_INL
+#undef DWARF_ONE_KNOWN_DW_INL
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3641,9 +3639,9 @@ dwarf_encoding_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ATE
-#undef ONE_KNOWN_DW_ATE
+#define DWARF_ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ATE
+#undef DWARF_ONE_KNOWN_DW_ATE
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3658,9 +3656,9 @@ dwarf_access_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ACCESS(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ACCESS
-#undef ONE_KNOWN_DW_ACCESS
+#define DWARF_ONE_KNOWN_DW_ACCESS(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ACCESS
+#undef DWARF_ONE_KNOWN_DW_ACCESS
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3675,9 +3673,9 @@ dwarf_visibility_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_VIS(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_VIS
-#undef ONE_KNOWN_DW_VIS
+#define DWARF_ONE_KNOWN_DW_VIS(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_VIS
+#undef DWARF_ONE_KNOWN_DW_VIS
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3692,9 +3690,9 @@ dwarf_virtuality_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_VIRTUALITY(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_VIRTUALITY
-#undef ONE_KNOWN_DW_VIRTUALITY
+#define DWARF_ONE_KNOWN_DW_VIRTUALITY(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_VIRTUALITY
+#undef DWARF_ONE_KNOWN_DW_VIRTUALITY
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3709,9 +3707,9 @@ dwarf_identifier_case_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ID(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ID
-#undef ONE_KNOWN_DW_ID
+#define DWARF_ONE_KNOWN_DW_ID(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ID
+#undef DWARF_ONE_KNOWN_DW_ID
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3726,9 +3724,9 @@ dwarf_calling_convention_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_CC(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_CC
-#undef ONE_KNOWN_DW_CC
+#define DWARF_ONE_KNOWN_DW_CC(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_CC
+#undef DWARF_ONE_KNOWN_DW_CC
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3743,9 +3741,9 @@ dwarf_ordering_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ORD(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ORD
-#undef ONE_KNOWN_DW_ORD
+#define DWARF_ONE_KNOWN_DW_ORD(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ORD
+#undef DWARF_ONE_KNOWN_DW_ORD
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3760,9 +3758,9 @@ dwarf_discr_list_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_DSC(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_DSC
-#undef ONE_KNOWN_DW_DSC
+#define DWARF_ONE_KNOWN_DW_DSC(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_DSC
+#undef DWARF_ONE_KNOWN_DW_DSC
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -3780,11 +3778,9 @@ dwarf_locexpr_opcode_string (unsigned int code)
/* Normally we can't affort building huge table of 64K entries,
most of them zero, just because there are a couple defined
values at the far end. In case of opcodes, it's OK. */
-#define ONE_KNOWN_DW_OP_DESC(NAME, CODE, DESC) ONE_KNOWN_DW_OP (NAME, CODE)
-#define ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP_DESC
+#define DWARF_ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_OP
+#undef DWARF_ONE_KNOWN_DW_OP
};
if (likely (code < sizeof (known) / sizeof (known[0])))
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c8530872..a029645b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,13 @@
2015-03-18 Petr Machata <pmachata@redhat.com>
+ * addrcfi.c (op_name): Adjust uses of know-dwarf.h macros to match
+ the API changes.
+ * allregs.c (dwarf_encoding_string): Likewise.
+ * show-die-info.c (dwarf_tag_string, dwarf_attr_string): Likewise.
+ * varlocs.c (dwarf_encoding_string, dwarf_opcode_string): Likewise.
+
+2015-03-18 Petr Machata <pmachata@redhat.com>
+
* Makefile.am (EXTRA_DIST): Add run-dwarf-ranges.sh,
debug-ranges-no-lowpc.o.bz2.
diff --git a/tests/addrcfi.c b/tests/addrcfi.c
index 8a2d126c..eb950c0b 100644
--- a/tests/addrcfi.c
+++ b/tests/addrcfi.c
@@ -1,5 +1,5 @@
/* Test program for CFI handling.
- Copyright (C) 2009-2010, 2013 Red Hat, Inc.
+ Copyright (C) 2009-2010, 2013, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -34,11 +34,9 @@ op_name (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_OP_DESC(NAME, CODE, DESC) ONE_KNOWN_DW_OP (NAME, CODE)
-#define ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP_DESC
+#define DWARF_ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_OP
+#undef DWARF_ONE_KNOWN_DW_OP
};
if (likely (code < sizeof (known) / sizeof (known[0])))
diff --git a/tests/allregs.c b/tests/allregs.c
index b103ce18..901d4e88 100644
--- a/tests/allregs.c
+++ b/tests/allregs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Red Hat, Inc.
+/* Copyright (C) 2005, 2006, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -35,9 +35,9 @@ dwarf_encoding_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ATE
-#undef ONE_KNOWN_DW_ATE
+#define DWARF_ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ATE
+#undef DWARF_ONE_KNOWN_DW_ATE
};
if (likely (code < sizeof (known) / sizeof (known[0])))
diff --git a/tests/show-die-info.c b/tests/show-die-info.c
index 0c298acd..34e27a3b 100644
--- a/tests/show-die-info.c
+++ b/tests/show-die-info.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002, 2004, 2006, 2012 Red Hat, Inc.
+/* Copyright (C) 1998-2002, 2004, 2006, 2012, 2015 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -33,9 +33,9 @@ dwarf_tag_string (unsigned int tag)
{
switch (tag)
{
-#define ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
- ALL_KNOWN_DW_TAG
-#undef ONE_KNOWN_DW_TAG
+#define DWARF_ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_TAG
+#undef DWARF_ONE_KNOWN_DW_TAG
default:
return NULL;
}
@@ -46,9 +46,9 @@ dwarf_attr_string (unsigned int attrnum)
{
switch (attrnum)
{
-#define ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME;
- ALL_KNOWN_DW_AT
-#undef ONE_KNOWN_DW_AT
+#define DWARF_ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_AT
+#undef DWARF_ONE_KNOWN_DW_AT
default:
return NULL;
}
diff --git a/tests/varlocs.c b/tests/varlocs.c
index 04f17ff2..b5733e7b 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -1,5 +1,5 @@
/* Test program for dwarf location functions.
- Copyright (C) 2013 Red Hat, Inc.
+ Copyright (C) 2013, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -64,9 +64,9 @@ dwarf_encoding_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_ATE
-#undef ONE_KNOWN_DW_ATE
+#define DWARF_ONE_KNOWN_DW_ATE(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_ATE
+#undef DWARF_ONE_KNOWN_DW_ATE
};
if (likely (code < sizeof (known) / sizeof (known[0])))
@@ -108,11 +108,9 @@ dwarf_opcode_string (unsigned int code)
{
static const char *const known[] =
{
-#define ONE_KNOWN_DW_OP_DESC(NAME, CODE, DESC) ONE_KNOWN_DW_OP (NAME, CODE)
-#define ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
- ALL_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP
-#undef ONE_KNOWN_DW_OP_DESC
+#define DWARF_ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_OP
+#undef DWARF_ONE_KNOWN_DW_OP
};
if (likely (code < sizeof (known) / sizeof (known[0])))