public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17917] New: gdbserver should lookup build-ids in the remote binaries
@ 2015-02-03  7:09 eseidel at google dot com
  2021-08-28  3:39 ` [Bug gdb/17917] " daniel at mariadb dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: eseidel at google dot com @ 2015-02-03  7:09 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-02 19:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03  7:09 [Bug gdb/17917] New: gdbserver should lookup build-ids in the remote binaries eseidel at google dot com
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

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).