From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28071 invoked by alias); 2 Feb 2015 17:36:36 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 28044 invoked by uid 48); 2 Feb 2015 17:36:35 -0000 From: "eseidel at google dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eseidel at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00171.txt.bz2 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.