public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "eseidel at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/17917] New: gdbserver should lookup build-ids in the remote binaries
Date: Tue, 03 Feb 2015 07:09:00 -0000	[thread overview]
Message-ID: <bug-17917-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=17917

            Bug ID: 17917
           Summary: gdbserver should lookup build-ids in the remote
                    binaries
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: eseidel at google dot com

gdbserver should lookup build-ids in the remote binaries

Right now gdbserver only sends the library_name back to gdb and gdb looks for
library_name in $PATH, etc.  Only if it finds library_name on the local machine
*then* it begins the .build-id search using the build-id it found in the local
binary.  In my application I don't always have a local binary (or have an easy
way to pull the binary from the remote), but I do have a .build-id tree full of
links to the symbold versions of all binarys on the remote.  Having gdbserver
send the build-id to gdb would be useful.


Steps:

1. Build your program (and libraries) with build-ids enabled
gcc -Wlbuild-id -o my_library.so library.

2. Setup a .build-id directory tree:
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
e.g.:
% readelf -n -e my_library.so
build-id: abcdef123456

mkdir -p .build-id/ab
ln -s my_libary_with_symbols.so .build-id/ab/cdef123456.debug

3. Launch under gdbserver on a remote system.
gdbserver :1234 my_program

4.  Connect to remote system:
gdb my_program
(gdb) target remote 1.2.3.4:1234

5.  Be sad that my_library has no symbols, even though you have a .build-id
directory for it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


             reply	other threads:[~2015-02-02 17:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03  7:09 eseidel at google dot com [this message]
2021-08-28  3:39 ` [Bug gdb/17917] " daniel at mariadb dot org
2021-08-28  6:51 ` daniel at mariadb dot org
2021-10-19 17:30 ` cvs-commit at gcc dot gnu.org
2021-10-19 17:42 ` tromey at sourceware dot org
2021-10-20  1:08 ` daniel at mariadb dot org
2021-10-20  2:06 ` tromey at sourceware dot org
2021-10-20  4:42 ` daniel at mariadb dot org
2023-01-02 19:31 ` tromey at sourceware dot org

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=bug-17917-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).