From a4c74cc67de22cb3208fc768989c509d6837cd77 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 18 May 2018 00:26:56 +0200 Subject: libdw: Handle split dwarf debuglines. Split DWARF .dwo files do contain a .debug_line section, but only with the file table, there is no actual line program. Also split DWARF CU DIEs don't have a DW_AT_stmt_list attribute. To get at the file (and dir) table for a split unit DIE take just the files from the .debug_line section (at offset zero). To get the full line table use the skeleton DIE (which does have a DW_AT_stmt_list). Signed-off-by: Mark Wielaard --- tests/ChangeLog | 6 +++++ tests/run-get-files.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index 05e8f26c..0370fbc6 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2018-05-18 Mark Wielaard + + * run-get-files.sh: Add testcases for testfile-splitdwarf-4, + testfile-hello4.dwo, testfile-world4.dwo and testfile-splitdwarf-5, + testfile-hello5.dwo, testfile-world5.dwo. + 2018-05-17 Mark Wielaard * Makefile.am (check_PROGRAMS): Add attr-integrate-skel. diff --git a/tests/run-get-files.sh b/tests/run-get-files.sh index a2f2373b..6f90be7d 100755 --- a/tests/run-get-files.sh +++ b/tests/run-get-files.sh @@ -64,4 +64,70 @@ cuhl = 11, o = 267, asz = 4, osz = 4, ncu = 2680 file[1] = "/shoggoth/drepper/m.c" EOF +# see tests/testfile-dwarf-45.source +testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo +testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo + +testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF +cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 52 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" + file[0] = "???" + file[1] = "/home/mark/src/elfutils/tests/hello.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" +cuhl = 11, o = 26, asz = 8, osz = 4, ncu = 104 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/usr/include" + file[0] = "???" + file[1] = "/home/mark/src/elfutils/tests/world.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/usr/include/stdlib.h" +cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 414 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" + file[0] = "???" + file[1] = "/home/mark/src/elfutils/tests/hello.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" +cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 331 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/usr/include" + file[0] = "???" + file[1] = "/home/mark/src/elfutils/tests/world.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/usr/include/stdlib.h" +EOF + +testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF +cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 53 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" + file[0] = "/home/mark/src/elfutils/tests/hello.c" + file[1] = "/home/mark/src/elfutils/tests/hello.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" +cuhl = 20, o = 21, asz = 8, osz = 4, ncu = 106 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/usr/include" + file[0] = "/home/mark/src/elfutils/tests/world.c" + file[1] = "/home/mark/src/elfutils/tests/world.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/usr/include/stdlib.h" +cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 386 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" + file[0] = "/home/mark/src/elfutils/tests/hello.c" + file[1] = "/home/mark/src/elfutils/tests/hello.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" +cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 296 + dirs[0] = "/home/mark/src/elfutils/tests" + dirs[1] = "/usr/include" + file[0] = "/home/mark/src/elfutils/tests/world.c" + file[1] = "/home/mark/src/elfutils/tests/world.c" + file[2] = "/home/mark/src/elfutils/tests/hello.h" + file[3] = "/usr/include/stdlib.h" +EOF + exit 0 -- cgit v1.2.3