+2012-07-27 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_aggregate_size.c,
+ dwarf_getlocation_implicit_pointer.c,
+ dwarf_access_string.c, dwarf_inline_string.c,
+ dwarf_attr_string.c dwarf_lang_string.c,
+ dwarf_calling_convention_string.c,
+ dwarf_line_extended_opcode_string.c,
+ dwarf_discr_list_string.c,
+ dwarf_line_standard_opcode_string.c,
+ dwarf_encoding_string.c dwarf_locexpr_opcode_string.c,
+ dwarf_form_string.c dwarf_ordering_string.c,
+ dwarf_tag_string.c dwarf_virtuality_string.c,
+ dwarf_identifier_case_string.c and dwarf_visibility_string.c
+ * dwarf_access_string.c: New file.
+ * dwarf_attr_string.c: Likewise.
+ * dwarf_calling_convention_string.c: Likewise.
+ * dwarf_discr_list_string.c: Likewise.
+ * dwarf_encoding_string.c: Likewise.
+ * dwarf_form_string.c: Likewise.
+ * dwarf_identifier_case_string.c: Likewise.
+ * dwarf_inline_string.c: Likewise.
+ * dwarf_lang_string.c: Likewise.
+ * dwarf_line_extended_opcode_string.c: Likewise.
+ * dwarf_line_standard_opcode_string.c: Likewise.
+ * dwarf_locexpr_opcode_string.c: Likewise.
+ * dwarf_ordering_string.c: Likewise.
+ * dwarf_tag_string.c: Likewise.
+ * dwarf_virtuality_string.c: Likewise.
+ * dwarf_visibility_string.c: Likewise.
+ * libdw.h: Declare dwarf_tag_string, dwarf_attr_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,
+ dwarf_line_standard_opcode_string and
+ dwarf_line_extended_opcode_string.
+ * libdw.map (ELFUTILS_0.155): New symbol version directive for
+ new functions.
+
2012-07-27 Mark Wielaard <mjw@redhat.com>
* Makefile.am (EXTRA_DIST): Add known-dwarf.h.
dwarf_frame_info.c dwarf_frame_cfa.c dwarf_frame_register.c \
dwarf_cfi_addrframe.c \
dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c \
- dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c
+ dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c \
+ dwarf_access_string.c dwarf_inline_string.c \
+ dwarf_attr_string.c dwarf_lang_string.c \
+ dwarf_calling_convention_string.c \
+ dwarf_line_extended_opcode_string.c \
+ dwarf_discr_list_string.c \
+ dwarf_line_standard_opcode_string.c \
+ dwarf_encoding_string.c dwarf_locexpr_opcode_string.c \
+ dwarf_form_string.c dwarf_ordering_string.c \
+ dwarf_tag_string.c dwarf_virtuality_string.c \
+ dwarf_identifier_case_string.c dwarf_visibility_string.c
if MAINTAINER_MODE
BUILT_SOURCES = $(srcdir)/known-dwarf.h
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+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;
+ }
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+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;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ default:
+ return NULL;
+ }
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ default:
+ return NULL;
+ }
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+dwarf_line_extended_opcode_string (unsigned int code)
+{
+ static const char *const known[] =
+ {
+#define ONE_KNOWN_DW_LNE(NAME, CODE) [CODE] = #NAME,
+ ALL_KNOWN_DW_LNE
+#undef ONE_KNOWN_DW_LNE
+ };
+
+ const char *ret = NULL;
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ ret = known[code];
+
+ return ret;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+dwarf_line_standard_opcode_string (unsigned int code)
+{
+ static const char *const known[] =
+ {
+#define ONE_KNOWN_DW_LNS(NAME, CODE) [CODE] = #NAME,
+ ALL_KNOWN_DW_LNS
+#undef ONE_KNOWN_DW_LNS
+ };
+
+ const char *ret = NULL;
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ ret = known[code];
+
+ return ret;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+dwarf_locexpr_opcode_string (unsigned int code)
+{
+ static const char *const known[] =
+ {
+ /* 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
+ };
+
+ const char *ret = NULL;
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ ret = known[code];
+
+ return ret;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+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;
+ }
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
--- /dev/null
+/* Copyright (C) 2012 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include "known-dwarf.h"
+#include "dwarf.h"
+
+const char *
+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
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
/* Interfaces for libdw.
- Copyright (C) 2002-2010 Red Hat, Inc.
+ Copyright (C) 2002-2010, 2012 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
extern Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler);
+/* Returns the tag name, without the DW_TAG_ prefix, if known.
+ Returns NULL if the given tag code is unknown. */
+extern const char *dwarf_tag_string (unsigned int code);
+
+/* Returns the attribute name, without the DW_AT_ prefix, if known.
+ Returns NULL if the given attribute code is unknown. */
+extern const char *dwarf_attr_string (unsigned int code);
+
+/* Returns the form name, without the DW_FORM_ prefix, if known.
+ Returns NULL if the given form code is unknown. */
+extern const char *dwarf_form_string (unsigned int code);
+
+/* Returns the language name, without the DW_LANG_ prefix, if known.
+ Returns NULL if the given language code is unknown. */
+extern const char *dwarf_lang_string (unsigned int code);
+
+/* Returns the inline name, without the DW_INL_ prefix, as used with
+ the DW_AT_inline attribute, if known. Returns NULL if the given
+ DW_LANG code is unknown. */
+extern const char *dwarf_inline_string (unsigned int code);
+
+/* Returns the encoding name, without the DW_ATE_ prefix, as used with
+ the DW_AT_encoding attribute, if known. Returns NULL if the given
+ DW_ATE code is unknown. */
+extern const char *dwarf_encoding_string (unsigned int code);
+
+/* Returns the access name, without the DW_ACCESS_ prefix, as used with
+ the DW_AT_accessibility attribute, if known. Returns NULL if the given
+ DW_ACCESS code is unknown. */
+extern const char *dwarf_access_string (unsigned int code);
+
+/* Returns the access name, without the DW_VIS_ prefix, as used with
+ the DW_AT_visibility attribute, if known. Returns NULL if the given
+ DW_VIS code is unknown. */
+extern const char *dwarf_visibility_string (unsigned int code);
+
+/* Returns the virtuality name, with the DW_VIRTUALITY_ prefix, as used
+ with the DW_AT_virtuality attribute, if known. Returns NULL if the
+ given DW_VIRTUALITY code is unknown. */
+extern const char *dwarf_virtuality_string (unsigned int code);
+
+/* Returns the identifier case name, without the DW_ID_ prefix, as used
+ with the DW_AT_identifier_case attribute, if known. Returns NULL if
+ the given DW_ID code is unknown. */
+extern const char *dwarf_identifier_case_string (unsigned int code);
+
+/* Returns the calling convention name, without the DW_CC_ prefix, as
+ used with the DW_AT_calling_convention attribute, if known. Returns
+ NULL if the given DW_CC code is unknown. */
+extern const char *dwarf_calling_convention_string (unsigned int code);
+
+/* Returns the ordering name, without the DW_ORD_ prefix, as
+ used with the DW_AT_ordering attribute, if known. Returns
+ NULL if the given DW_CC code is unknown. */
+extern const char *dwarf_ordering_string (unsigned int code);
+
+/* Returns the discriminant list name, without the DW_ORD_ prefix, as
+ used in the DW_AT_ordering attribute block, if known. Returns
+ NULL if the given DW_CC code is unknown. */
+extern const char *dwarf_discr_list_string (unsigned int code);
+
+/* Returns the operation name, without the DW_OP_ prefix, as
+ used in a DWARF location expression block, if known. Returns
+ NULL if the given DW_OP code is unknown. */
+extern const char *dwarf_locexpr_opcode_string (unsigned int code);
+
+/* Returns the standard line information opcode name, without the
+ DW_LNS_ prefix, as used in the line number program instructions,
+ if known. Returns NULL if the given DW_LNS opcode is unknown. */
+extern const char *dwarf_line_standard_opcode_string (unsigned int code);
+
+/* Returns the extended line information opcode name, without the
+ DW_LNE_ prefix, as used in the line number program instructions,
+ if known. Returns NULL if the given DW_LNE opcode is unknown. */
+extern const char *dwarf_line_extended_opcode_string (unsigned int code);
+
+
/* Inline optimizations. */
#ifdef __OPTIMIZE__
/* Return attribute code of given attribute. */
dwfl_dwarf_line;
} ELFUTILS_0.148;
+
+ELFUTILS_0.155 {
+ global:
+ 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;
+ dwarf_line_standard_opcode_string;
+ dwarf_line_extended_opcode_string;
+} ELFUTILS_0.149;
+2012-07-27 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (dwarf_tag_string): Removed.
+ (dwarf_attr_string): Likewise.
+ (dwarf_form_string): Likewise.
+ (dwarf_lang_string): Likewise.
+ (dwarf_inline_string): Likewise.
+ (dwarf_encoding_string): Likewise.
+ (dwarf_access_string): Likewise.
+ (dwarf_visibility_string): Likewise.
+ (dwarf_virtuality_string): Likewise.
+ (dwarf_identifier_case_string): Likewise.
+ (dwarf_calling_convention_string): Likewise.
+ (dwarf_ordering_string): Likewise.
+ (dwarf_discr_list_string): Likewise.
+ (dwarf_locexpr_opcode_string): Likewise.
+
2012-07-27 Mark Wielaard <mjw@redhat.com>
* readelf.c (dwarf_tag_name): Renamed from dwarf_tag_string.
#include "../libdwfl/libdwflP.h"
#include "../libdw/memory-access.h"
-#include "../libdw/known-dwarf.h"
-
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
return result;
}
-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;
- }
-}
-
-
-static const char *
-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
- default:
- return NULL;
- }
-}
-
-
-static const char *
-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
- default:
- return NULL;
- }
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-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 const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-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
- };
-
- if (likely (code < sizeof (known) / sizeof (known[0])))
- return known[code];
-
- return NULL;
-}
-
-
-static const char *
-dwarf_locexpr_opcode_string (unsigned int code)
-{
- static const char *const known[] =
- {
- /* 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
- };
-
- const char *ret = NULL;
- if (likely (code < sizeof (known) / sizeof (known[0])))
- ret = known[code];
-
- return ret;
-}
-
/* Reused by all dwarf_foo_name functions. */
static char unknown_buf[16];
+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
-/* 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
#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,
#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)