diff options
author | Mark Wielaard <mjw@redhat.com> | 2012-07-29 23:47:28 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2012-08-16 22:26:23 +0200 |
commit | fdf68c53b1dc3ff42d19fdbce5ddebbf8df2724d (patch) | |
tree | 97a9da973fa4d7725c2e5448a8b88db05cd37c5e /tests | |
parent | cfcc7025e4f93e6732593a03ef02ebe3bd441d38 (diff) | |
download | elfutils-fdf68c53b1dc3ff42d19fdbce5ddebbf8df2724d.tar.gz |
libdw: Add dwarfstrings functions.
Introduce dwarf_access_string, dwarf_attr_string,
dwarf_calling_convention_string, dwarf_discr_list_string,
dwarf_encoding_string, dwarf_form_string, dwarf_identifier_case_string,
dwarf_inline_string, dwarf_lang_string, dwarf_line_extended_opcode_string,
dwarf_line_standard_opcode_string, dwarf_locexpr_opcode_string,
dwarf_ordering_string, dwarf_tag_string, dwarf_virtuality_string,
dwarf_visibility_string from dwarf branch.
Remove similar functions from readelf and tests.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 6 | ||||
-rw-r--r-- | tests/allregs.c | 20 | ||||
-rw-r--r-- | tests/show-die-info.c | 28 |
3 files changed, 7 insertions, 47 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 823f82ee..24ba17e6 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,11 @@ 2012-07-27 Mark Wielaard <mjw@redhat.com> + * allregs.c (dwarf_encoding_string): Removed. + * show-die-info.c (dwarf_tag_string): Removed. + (dwarf_attr_string): Removed. + +2012-07-27 Mark Wielaard <mjw@redhat.com> + * allregs.c (dwarf_encoding_string): Rewritten using known-dwarf macros. * show-die-info.c (tagnames): Removed. diff --git a/tests/allregs.c b/tests/allregs.c index b103ce18..85bcb5cd 100644 --- a/tests/allregs.c +++ b/tests/allregs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2006 Red Hat, Inc. +/* Copyright (C) 2005, 2006, 2012 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -28,24 +28,6 @@ #include ELFUTILS_HEADER(dwfl) #include <dwarf.h> -#include "../libdw/known-dwarf.h" - -static const char * -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 - }; - - if (likely (code < sizeof (known) / sizeof (known[0]))) - return known[code]; - - return NULL; -} - static int first_module (Dwfl_Module *mod, diff --git a/tests/show-die-info.c b/tests/show-die-info.c index 0c298acd..624a71dc 100644 --- a/tests/show-die-info.c +++ b/tests/show-die-info.c @@ -26,34 +26,6 @@ #include <string.h> #include <unistd.h> -#include "../libdw/known-dwarf.h" - -static const char * -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 - default: - return NULL; - } -} - -static const char * -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 - default: - return NULL; - } -} - void handle (Dwarf *dbg, Dwarf_Die *die, int n) |