+2015-01-14 Mark Wielaard <mjw@redhat.com>
+
+ * testfile-debug-types.bz2: New testfile.
+ * Makefile.am (EXTRA_DIST): Add testfile-debug-types.bz2.
+ * typeiter2.c (main): Print both name and offset of found form DIE.
+ * run-typeiter.s: Adjust output and add testfile-debug-types.
+
2014-12-26 Mark Wielaard <mjw@redhat.com>
* run-test-archive64.sh: Add nm test.
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 1996-2014 Red Hat, Inc.
+## Copyright (C) 1996-2015 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
linkmap-cut.bz2 linkmap-cut.core.bz2 \
run-aggregate-size.sh testfile-sizes1.o.bz2 testfile-sizes2.o.bz2 \
testfile-sizes3.o.bz2 \
- run-readelf-A.sh testfileppc32attrs.o.bz2
+ run-readelf-A.sh testfileppc32attrs.o.bz2 \
+ testfile-debug-types.bz2
if USE_VALGRIND
valgrind_cmd='valgrind -q --error-exitcode=1 --run-libc-freeres=no'
#! /bin/sh
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012, 2015 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
#
# g++ -gdwarf-4 -g -fdebug-types-section
-testfiles testfile59
+# echo 'struct A{ struct B {} x;};A a; A::B b;int main(){return 0;}' \
+# | g++ -x c++ -g -fdebug-types-section -o testfile-debug-types -
+
+testfiles testfile59 testfile-debug-types
testrun_compare ${abs_builddir}/typeiter testfile59 <<\EOF
ok
EOF
testrun_compare ${abs_builddir}/typeiter2 testfile59 <<\EOF
-ok
+ok s1 [25]
+EOF
+
+testrun_compare ${abs_builddir}/typeiter2 testfile-debug-types <<\EOF
+ok A [68]
+ok B [38]
EOF
exit 0
-/* Copyright (C) 2012, 2013 Red Hat, Inc.
+/* Copyright (C) 2012, 2013, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
#include <stdio.h>
#include <unistd.h>
#include <dwarf.h>
+#include <inttypes.h>
int
main (int argc, char *argv[])
if (form == NULL)
printf ("fail\n");
else
- printf ("ok\n");
+ printf ("ok %s [%" PRIx64 "]\n",
+ dwarf_diename (form), dwarf_dieoffset (form));
}
if (dwarf_siblingof (iter, &iter_mem) != 0)