aboutsummaryrefslogtreecommitdiff
path: root/gdb/opencl-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2019-02-22 15:09:23 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2019-02-22 15:49:57 -0500
commit07bc701d03167b8006835da583a03d98177cd4b6 (patch)
tree1581a3c9499b225762fabd76823acd4a8151a11f /gdb/opencl-lang.c
parentc6f4a5d0ed1ff54b5d46bdbadaa4ad811de1b715 (diff)
downloadgdb-07bc701d03167b8006835da583a03d98177cd4b6.zip
gdb-07bc701d03167b8006835da583a03d98177cd4b6.tar.gz
gdb-07bc701d03167b8006835da583a03d98177cd4b6.tar.bz2
Look for build-id-based separate debug files under the sysroot
When looking for a separate debug file that matches a given build-id, GDB only looks in the host's debug dir (typically /usr/lib/debug). This patch makes it look in the sysroot as well. This is to match the behavior of GDB when using debuglink-based separate debug files, introduced in : 402d2bfec42 ("Look for separate debug files in debug directories under a sysroot.") In the following example, my sysroot is "/tmp/sysroot" and I am trying to load symbols for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so. This is the current behavior: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path <snip> (No debugging symbols found in /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so) With this patch: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path Trying /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... yes! Reading symbols from /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... In the original code, there is a suspicious "abfd.release ()" in build_id_to_debug_bfd, that I don't understand. If a file with the right name exists but its build-id note doesn't match, we release (leak) our reference, meaning the file will stay open? I removed it in the new code, so that the reference is dropped if we end up not using that file. I tested briefly by corrupting a separate debug file to trigger this code, nothing exploded. gdb/ChangeLog: * build-id.c (build_id_to_debug_bfd_1): New function. (build_id_to_debug_bfd): Look for separate debug file in sysroot.
Diffstat (limited to 'gdb/opencl-lang.c')
0 files changed, 0 insertions, 0 deletions