public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Fix search of debug files for remote debuggee
Date: Wed, 02 Jan 2019 20:08:00 -0000	[thread overview]
Message-ID: <5d36dfb949751663bcb814b3cc780ed8f47442b4@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 5d36dfb949751663bcb814b3cc780ed8f47442b4 ***

Author: Andrey Utkin <autkin@undo.io>
Branch: master
Commit: 5d36dfb949751663bcb814b3cc780ed8f47442b4

Fix search of debug files for remote debuggee

When using remote debugging server, and when debuggee filename is
inferred via qXfer:exec-file:read request, or sysroot starts with
"target:", this "target:" prefix of filepaths is not treated correctly
during debug file search - it appears in the middle of the looked up
paths.

In the following example, unpatched GDB can't find separate debug files for
neither the executable, nor standard libraries:

     $ gdb -ex 'set debug separate-debug-file 1' -ex 'set sysroot target:/' -ex 'set debug-file-directory /usr/lib/debug:/home/j/hide' -ex 'target remote :3333' -ex 'break main' -ex 'continue' -ex 'bt' -ex 'info sharedlibrary' -ex 'set confirm off' -ex 'quit'
    GNU gdb (Gentoo 9999 vanilla) 8.2.50.20181109-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "x86_64-pc-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <https://bugs.gentoo.org/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.

    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    Remote debugging using :3333
    Reading /home/j/test from remote target...
    warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
    Reading /home/j/test from remote target...
    Reading symbols from target:/home/j/test...

    Looking for separate debug info (debug link) for target:/home/j/test
      Trying target:/home/j/test.debug
    Reading /home/j/test.debug from remote target...
      Trying target:/home/j/.debug/test.debug
    Reading /home/j/.debug/test.debug from remote target...
      Trying /usr/lib/debug/target:/home/j/test.debug
      Trying /home/j/hide/target:/home/j/test.debug
    (No debugging symbols found in target:/home/j/test)
    Reading /lib64/ld-linux-x86-64.so.2 from remote target...
    Reading /lib64/ld-linux-x86-64.so.2 from remote target...
    Reading symbols from target:/lib64/ld-linux-x86-64.so.2...

    Looking for separate debug info (debug link) for target:/lib64/ld-linux-x86-64.so.2
      Trying target:/lib64/ld-2.27.so.debug
    Reading /lib64/ld-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/ld-2.27.so.debug
    Reading /lib64/.debug/ld-2.27.so.debug from remote target...
      Trying /usr/lib/debug/target:/lib64/ld-2.27.so.debug
      Trying /home/j/hide/target:/lib64/ld-2.27.so.debug
    (No debugging symbols found in target:/lib64/ld-linux-x86-64.so.2)

    Looking for separate debug info (build-id) for system-supplied DSO at 0x7ffff7ffa000
      Trying /usr/lib/debug/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug
      Trying /home/j/hide/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug
    0x00007ffff7dd7000 in ?? () from target:/lib64/ld-linux-x86-64.so.2
    Breakpoint 1 at 0x4005eb
    Continuing.
    Reading /lib64/libpthread.so.0 from remote target...
    Reading /lib64/libc.so.6 from remote target...

    Looking for separate debug info (debug link) for target:/lib64/libpthread.so.0
      Trying target:/lib64/libpthread-2.27.so.debug
    Reading /lib64/libpthread-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/libpthread-2.27.so.debug
    Reading /lib64/.debug/libpthread-2.27.so.debug from remote target...
      Trying /usr/lib/debug/target:/lib64/libpthread-2.27.so.debug
      Trying /home/j/hide/target:/lib64/libpthread-2.27.so.debug

    Looking for separate debug info (debug link) for target:/lib64/libc.so.6
      Trying target:/lib64/libc-2.27.so.debug
    Reading /lib64/libc-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/libc-2.27.so.debug
    Reading /lib64/.debug/libc-2.27.so.debug from remote target...
      Trying /usr/lib/debug/target:/lib64/libc-2.27.so.debug
      Trying /home/j/hide/target:/lib64/libc-2.27.so.debug

    Breakpoint 1, 0x00000000004005eb in main ()
    #0  0x00000000004005eb in main ()
    From                To                  Syms Read   Shared Object Library
    0x00007ffff7dd6e80  0x00007ffff7df4650  Yes (*)     target:/lib64/ld-linux-x86-64.so.2
    0x00007ffff7bbbb70  0x00007ffff7bcbfee  Yes (*)     target:/lib64/libpthread.so.0
    0x00007ffff780f200  0x00007ffff7962d7c  Yes (*)     target:/lib64/libc.so.6
    (*): Shared library is missing debugging information.

With current fix, the paths used always have target: in the beginning
and this helps to find all debug files:

     $ gdb -ex 'set debug separate-debug-file 1' -ex 'set sysroot target:/' -ex 'set debug-file-directory /usr/lib/debug:/home/j/hide' -ex 'target remote :3333' -ex 'break main' -ex 'continue' -ex 'bt' -ex 'info sharedlibrary' -ex 'set confirm off' -ex 'quit'
    GNU gdb (Gentoo 9999 vanilla) 8.2.50.20181109-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "x86_64-pc-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <https://bugs.gentoo.org/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.

    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    Remote debugging using :3333
    Reading /home/j/test from remote target...
    warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
    Reading /home/j/test from remote target...
    Reading symbols from target:/home/j/test...

    Looking for separate debug info (debug link) for target:/home/j/test
      Trying target:/home/j/test.debug
    Reading /home/j/test.debug from remote target...
      Trying target:/home/j/.debug/test.debug
    Reading /home/j/.debug/test.debug from remote target...
      Trying target:/usr/lib/debug//home/j/test.debug
    Reading /usr/lib/debug//home/j/test.debug from remote target...
      Trying target:/home/j/hide//home/j/test.debug
    Reading /home/j/hide//home/j/test.debug from remote target...
    Reading /home/j/hide//home/j/test.debug from remote target...
    Reading symbols from target:/home/j/hide//home/j/test.debug...
    Reading /lib64/ld-linux-x86-64.so.2 from remote target...
    Reading /lib64/ld-linux-x86-64.so.2 from remote target...
    Reading symbols from target:/lib64/ld-linux-x86-64.so.2...

    Looking for separate debug info (debug link) for target:/lib64/ld-linux-x86-64.so.2
      Trying target:/lib64/ld-2.27.so.debug
    Reading /lib64/ld-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/ld-2.27.so.debug
    Reading /lib64/.debug/ld-2.27.so.debug from remote target...
      Trying target:/usr/lib/debug//lib64/ld-2.27.so.debug
    Reading /usr/lib/debug//lib64/ld-2.27.so.debug from remote target...
    Reading /usr/lib/debug//lib64/ld-2.27.so.debug from remote target...
    Reading symbols from target:/usr/lib/debug//lib64/ld-2.27.so.debug...

    Looking for separate debug info (build-id) for system-supplied DSO at 0x7ffff7ffa000
      Trying /usr/lib/debug/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug
      Trying /home/j/hide/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug
    0x00007ffff7dd7000 in _start () from target:/lib64/ld-linux-x86-64.so.2
    Breakpoint 1 at 0x4005ef: file test/test16.c, line 13.
    Continuing.
    Reading /lib64/libpthread.so.0 from remote target...
    Reading /lib64/libc.so.6 from remote target...

    Looking for separate debug info (debug link) for target:/lib64/libpthread.so.0
      Trying target:/lib64/libpthread-2.27.so.debug
    Reading /lib64/libpthread-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/libpthread-2.27.so.debug
    Reading /lib64/.debug/libpthread-2.27.so.debug from remote target...
      Trying target:/usr/lib/debug//lib64/libpthread-2.27.so.debug
    Reading /usr/lib/debug//lib64/libpthread-2.27.so.debug from remote target...
    Reading /usr/lib/debug//lib64/libpthread-2.27.so.debug from remote target...

    Looking for separate debug info (debug link) for target:/lib64/libc.so.6
      Trying target:/lib64/libc-2.27.so.debug
    Reading /lib64/libc-2.27.so.debug from remote target...
      Trying target:/lib64/.debug/libc-2.27.so.debug
    Reading /lib64/.debug/libc-2.27.so.debug from remote target...
      Trying target:/usr/lib/debug//lib64/libc-2.27.so.debug
    Reading /usr/lib/debug//lib64/libc-2.27.so.debug from remote target...
    Reading /usr/lib/debug//lib64/libc-2.27.so.debug from remote target...

    Breakpoint 1, main () at test/test16.c:13
    13          for ( i=0; i<10; ++i)
    #0  main () at test/test16.c:13
    From                To                  Syms Read   Shared Object Library
    0x00007ffff7dd6e80  0x00007ffff7df4650  Yes         target:/lib64/ld-linux-x86-64.so.2
    0x00007ffff7bbbb70  0x00007ffff7bcbfee  Yes         target:/lib64/libpthread.so.0
    0x00007ffff780f200  0x00007ffff7962d7c  Yes         target:/lib64/libc.so.6

gdb/ChangeLog:

2018-11-09  Andrey Utkin  <autkin@undo.io>

        * symfile.c (find_separate_debug_file): Fix search of debug files for
        remote debuggee.

Signed-off-by: Andrey Utkin <autkin@undo.io>


             reply	other threads:[~2019-01-02 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 20:08 sergiodj+buildbot [this message]
2019-01-02 20:08 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
2019-01-02 20:19 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2019-01-02 20:30 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-02 21:00 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2019-01-02 21:01 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-02 21:04 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2019-01-02 21:14 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2019-01-02 21:22 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2019-01-02 21:42 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " sergiodj+buildbot
2019-01-02 22:15 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2019-01-02 23:18 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " sergiodj+buildbot
2019-01-02 23:41 ` Failures on Ubuntu-Aarch64-m64, " sergiodj+buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d36dfb949751663bcb814b3cc780ed8f47442b4@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).