+2012-06-26 Mark Wielaard <mjw@redhat.com>
+
+ * libdwP.h: Add IDX_debug_macro.
+ * dwarf.h: Add DW_AT_GNU_macros.
+ * dwarf_begin_elf.c (dwarf_scnnames): Add .debug_macro.
+ * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_macros.
+
2012-04-27 Mark Wielaard <mjw@redhat.com>
* libdw/dwarf_highpc.c (dwarf_highpc): Handle DW_AT_high_pc being
DW_AT_GNU_all_tail_call_sites = 0x2116,
DW_AT_GNU_all_call_sites = 0x2117,
DW_AT_GNU_all_source_call_sites = 0x2118,
+ DW_AT_GNU_macros = 0x2119,
DW_AT_hi_user = 0x3fff
};
[IDX_debug_pubnames] = ".debug_pubnames",
[IDX_debug_str] = ".debug_str",
[IDX_debug_macinfo] = ".debug_macinfo",
+ [IDX_debug_macro] = ".debug_macro",
[IDX_debug_ranges] = ".debug_ranges"
};
#define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
break;
case DW_AT_macro_info:
- /* macptr */
+ /* macptr into .debug_macinfo */
if (__libdw_formptr (attr, IDX_debug_macinfo,
DWARF_E_NO_ENTRY, NULL,
return_uval) == NULL)
return -1;
break;
+ case DW_AT_GNU_macros:
+ /* macptr into .debug_macro */
+ if (__libdw_formptr (attr, IDX_debug_macro,
+ DWARF_E_NO_ENTRY, NULL,
+ return_uval) == NULL)
+ return -1;
+ break;
+
case DW_AT_ranges:
case DW_AT_start_scope:
/* rangelistptr */
IDX_debug_pubnames,
IDX_debug_str,
IDX_debug_macinfo,
+ IDX_debug_macro,
IDX_debug_ranges,
IDX_last
};
+2011-06-26 Mark Wielaard <mjw@redhat.com>
+
+ * eblopenbackend.c (default_debugscn_p): Add .debug_macro.
+
2011-04-26 Mark Wielaard <mjw@redhat.com>
* libebl.h (ebl_object_note_type_name): Add const char *name arg.
".debug_types",
/* GDB DWARF 4 extension */
".gdb_index",
+ /* GNU/DWARF 5 extension/proposal */
+ ".debug_macro",
/* SGI/MIPS DWARF 2 extensions */
".debug_weaknames",
".debug_funcnames",
+2012-06-26 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (dwarf_attr_string): Add DW_AT_GNU_macros.
+
2012-06-22 Mark Wielaard <mjw@redhat.com>
* readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t
result = "GNU_all_source_call_sites";
break;
+ case DW_AT_GNU_macros:
+ result = "GNU_macros";
+ break;
+
default:
if (attrnum < DW_AT_lo_user)
snprintf (buf, sizeof buf, gettext ("unknown attribute %hx"),
+2012-06-26 Mark Wielaard <mjw@redhat.com>
+
+ * run-macro-test.sh: New test.
+ * testfile-macinfo.bz2: New testfile.
+ * testfile-macros.bz2: Likewise.
+
2012-05-07 Mark Wielaard <mjw@redhat.com>
* low_high_pc.c: Use proper inttypes in printf formats.
run-early-offscn.sh run-dwarf-getmacros.sh \
run-test-flag-nobits.sh run-prelink-addr-test.sh \
run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \
- run-readelf-d.sh run-unstrip-n.sh run-low_high_pc.sh
+ run-readelf-d.sh run-unstrip-n.sh run-low_high_pc.sh \
+ run-macro-test.sh
if !STANDALONE
noinst_PROGRAMS += msg_tst md5-sha1-test
run-typeiter.sh testfile59.bz2 \
run-readelf-d.sh testlib_dynseg.so.bz2 \
run-unstrip-n.sh testcore-rtlib.bz2 \
- run-low_high_pc.sh testfile_low_high_pc.bz2
+ run-low_high_pc.sh testfile_low_high_pc.bz2 \
+ run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
--- /dev/null
+#! /bin/sh
+# 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 the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# 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 a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/test-subr.sh
+
+# #include <string.h>
+#
+# #define HELLO "world"
+#
+# int
+# main(int argc, char ** argv)
+# {
+# return strlen (HELLO);
+# }
+#
+# gcc -gdwarf-4 -g3 -o testfile-macros macro.c
+# gcc -gstrict-dwarf -gdwarf-4 -g3 -o testfile-macinfo macro.c
+
+testfiles testfile-macinfo testfile-macros
+
+status=0
+
+testrun ../src/readelf --debug-dump=info testfile-macinfo \
+ | grep macro_info > readelf.macros.out ||
+ { echo "*** failure readelf --debug-dump=info testfile-macinfo"; status=1; }
+testrun_compare cat readelf.macros.out <<\EOF
+ macro_info (sec_offset) 0
+EOF
+
+testrun ../src/readelf --debug-dump=info testfile-macros \
+ | grep GNU_macros > readelf.macros.out ||
+ { echo "*** failure readelf --debug-dump=info testfile-macros"; status=1; }
+testrun_compare cat readelf.macros.out <<\EOF
+ GNU_macros (sec_offset) 0
+EOF
+
+rm -f readelf.macros.out
+
+exit $status