diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2018-07-03 19:20:56 +0200 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-08-22 19:38:41 +0900 |
commit | f4e51cf1042307cdd45ee34c761424e7848ccc26 (patch) | |
tree | a30506dd968ed147842e14d36db3ed94284db262 | |
parent | ff52ae18cf779f109081c33937b8f123780b69b5 (diff) | |
download | buildstream-f4e51cf1042307cdd45ee34c761424e7848ccc26.tar.gz |
Don't strip pathname from debug symbol files
When GDB looks for debug symbols it looks for the full path of the file
inside the configured debug-file-directory. For example, if the
debug-file-directory is set to a default of /usr/lib/debug, and you are
debugging /usr/bin/python3, GDB will look for its debug symbols at this
location: /usr/lib/debug/usr/bin/python3.
BuildStream has been putting all debug files inside /usr/lib/debug
under their $(basename), so in the above example GDB would fail to find
any debug symbols for /usr/bin/python3 because they would be in the
incorrect locatoin of /usr/lib/debug/python3.
-rw-r--r-- | buildstream/data/projectconfig.yaml | 4 | ||||
-rw-r--r-- | tests/cachekey/project/elements/build1.expected | 2 | ||||
-rw-r--r-- | tests/cachekey/project/elements/build2.expected | 2 | ||||
-rw-r--r-- | tests/cachekey/project/target.expected | 2 | ||||
-rw-r--r-- | tests/examples/autotools.py | 4 | ||||
-rw-r--r-- | tests/examples/developing.py | 4 | ||||
-rw-r--r-- | tests/examples/flatpak-autotools.py | 6 | ||||
-rw-r--r-- | tests/integration/autotools.py | 6 | ||||
-rw-r--r-- | tests/integration/cmake.py | 4 | ||||
-rw-r--r-- | tests/integration/compose.py | 14 |
10 files changed, 32 insertions, 16 deletions
diff --git a/buildstream/data/projectconfig.yaml b/buildstream/data/projectconfig.yaml index 686040ee0..c1ad2d147 100644 --- a/buildstream/data/projectconfig.yaml +++ b/buildstream/data/projectconfig.yaml @@ -68,7 +68,7 @@ variables: # Generic implementation for stripping debugging symbols strip-binaries: | - find "%{install-root}" -type f \ + cd "%{install-root}" && find -type f \ '(' -perm -111 -o -name '*.so*' \ -o -name '*.cmxs' -o -name '*.node' ')' \ -exec sh -ec \ @@ -76,7 +76,7 @@ variables: if [ "$hdr" != "$(printf \\x7fELF)" ]; then exit 0 fi - debugfile="%{install-root}%{debugdir}/$(basename "$1")" + debugfile="%{install-root}%{debugdir}/$1" mkdir -p "$(dirname "$debugfile")" objcopy %{objcopy-extract-args} "$1" "$debugfile" chmod 644 "$debugfile" diff --git a/tests/cachekey/project/elements/build1.expected b/tests/cachekey/project/elements/build1.expected index 1b41b5e06..5b3a9ad71 100644 --- a/tests/cachekey/project/elements/build1.expected +++ b/tests/cachekey/project/elements/build1.expected @@ -1 +1 @@ -90fa9c1b5334aac3bfd8956d92af0a91e2f2bbcbcac73861957165e577bc8768
\ No newline at end of file +05429485dff08bdb968f7d10c2cdda63be49c8a783d54863a0d4abce44bbebe9
\ No newline at end of file diff --git a/tests/cachekey/project/elements/build2.expected b/tests/cachekey/project/elements/build2.expected index 83c2bb1b3..9641bd05b 100644 --- a/tests/cachekey/project/elements/build2.expected +++ b/tests/cachekey/project/elements/build2.expected @@ -1 +1 @@ -a62c29fe4e05820412e391430f61aa88a1a82e138de8cac726a9dc4fcd7ed8b9
\ No newline at end of file +4155c7bc836cdb092de3241fa92883bd8c7dd94c55affa406e559aeb6252c669
\ No newline at end of file diff --git a/tests/cachekey/project/target.expected b/tests/cachekey/project/target.expected index 3c1cc261f..3e7cc81db 100644 --- a/tests/cachekey/project/target.expected +++ b/tests/cachekey/project/target.expected @@ -1 +1 @@ -09620aa58875d96611d22632b7585a0f22f88f5ecca6f5d1915d3e529d036bd8
\ No newline at end of file +f5affaacd3ac724f5415a7a8349c6dca6122841dd7f9769de4f9d6cb7185f9b8
\ No newline at end of file diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py index c774776fb..37f6ed0e3 100644 --- a/tests/examples/autotools.py +++ b/tests/examples/autotools.py @@ -28,7 +28,9 @@ def test_autotools_build(cli, tmpdir, datafiles): assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', + '/usr/bin/hello', '/usr/share/doc', '/usr/share/doc/amhello', '/usr/share/doc/amhello/README']) diff --git a/tests/examples/developing.py b/tests/examples/developing.py index 4c488d962..bca6ac61d 100644 --- a/tests/examples/developing.py +++ b/tests/examples/developing.py @@ -29,7 +29,9 @@ def test_autotools_build(cli, tmpdir, datafiles): assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello']) + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', + '/usr/bin/hello']) # Test the unmodified hello command works as expected. diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py index 3965725c7..2d02755fc 100644 --- a/tests/examples/flatpak-autotools.py +++ b/tests/examples/flatpak-autotools.py @@ -47,8 +47,10 @@ def test_autotools_build(cli, tmpdir, datafiles): assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello', - '/usr/share/doc', '/usr/share/doc/amhello', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', + '/usr/bin/hello', '/usr/share/doc', + '/usr/share/doc/amhello', '/usr/share/doc/amhello/README']) diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index 0c9ac6cd8..6ea2b667c 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/autotools.py @@ -31,8 +31,10 @@ def test_autotools_build(cli, tmpdir, datafiles): assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello', - '/usr/share/doc', '/usr/share/doc/amhello', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', + '/usr/bin/hello', '/usr/share/doc', + '/usr/share/doc/amhello', '/usr/share/doc/amhello/README']) diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index 8f017e707..3c16b29b9 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.py @@ -27,7 +27,9 @@ def test_cmake_build(cli, tmpdir, datafiles): assert result.exit_code == 0 assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello', - '/usr/lib/debug', '/usr/lib/debug/hello']) + '/usr/lib/debug', '/usr/lib/debug/usr', + '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello']) @pytest.mark.datafiles(DATA_DIR) diff --git a/tests/integration/compose.py b/tests/integration/compose.py index 00c80d58b..d203181bd 100644 --- a/tests/integration/compose.py +++ b/tests/integration/compose.py @@ -39,7 +39,8 @@ def create_compose_element(name, path, config={}): # Test flat inclusion ([], [], ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', '/usr/bin/hello', '/usr/share/doc', '/usr/share/doc/amhello', '/usr/share/doc/amhello/README', '/tests', '/tests/test']), @@ -53,13 +54,17 @@ def create_compose_element(name, path, config={}): '/usr/share/doc/amhello/README']), # Test with only runtime excluded ([], ['runtime'], ['/usr', '/usr/lib', '/usr/share', - '/usr/lib/debug', '/usr/lib/debug/hello', + '/usr/lib/debug', '/usr/lib/debug/usr', + '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', '/usr/share/doc', '/usr/share/doc/amhello', '/usr/share/doc/amhello/README', '/tests', '/tests/test']), # Test with runtime and doc excluded ([], ['runtime', 'doc'], ['/usr', '/usr/lib', '/usr/share', - '/usr/lib/debug', '/usr/lib/debug/hello', + '/usr/lib/debug', '/usr/lib/debug/usr', + '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', '/tests', '/tests/test']), # Test with runtime simultaneously in- and excluded (['runtime'], ['runtime'], ['/usr', '/usr/lib', '/usr/share']), @@ -72,7 +77,8 @@ def create_compose_element(name, path, config={}): # Test excluding a custom 'test' domain ([], ['test'], ['/usr', '/usr/lib', '/usr/bin', '/usr/share', '/usr/lib/debug', - '/usr/lib/debug/hello', '/usr/bin/hello', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', '/usr/bin/hello', '/usr/share/doc', '/usr/share/doc/amhello', '/usr/share/doc/amhello/README']) ]) |