From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52774 invoked by alias); 23 Jan 2019 01:04:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 52753 invoked by uid 89); 23 Jan 2019 01:04:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.2 required=5.0 tests=BAYES_00,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-languages-length:1606, HContent-Transfer-Encoding:8bit X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jan 2019 01:04:12 +0000 Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1FBD010AFCD for ; Tue, 22 Jan 2019 20:04:10 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Some fixes for debug files and sysroots Date: Wed, 23 Jan 2019 01:04:00 -0000 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00491.txt.bz2 When working on non-x86 architectures, I often install a base system to a sysroot directory that I then use to generate a filesystem for use with qemu using a tool like makefs. Since this sysroot is a full system install, it also contains a nested global debugfile directory for base system libraries and binaries (e.g. /sysroot/usr/lib/debug/bin/ls.debug for /sysroot/bin/ls). GDB's current logic for handling separate debug files does not look for debug files in debug directories under a sysroot. These two patches seek to make this work seamlessly (my current workaround is to go create a symlink from /usr/lib/debug/sysroot to /sysroot/usr/lib/debug on the host and these patches remove the need for that). The first patch augments the existing logic to add another path check for //. The second patch is a convenience to deal with tab completion of directories passed to 'set sysroot' usually adding a trailing / that then breaks the logic for separate debug files. Rather than trying to cope with a possible trailing separator in find_separate_debug_file, I instead chose to "fix" the sysroot to when it is set to remove the trailing /. One downside of this is that it doesn't fix a static sysroot set at build time with --sysroot. John Baldwin (2): Look for separate debug files in debug directories under a sysroot. Trim trailing directory separators from new sysroots. gdb/ChangeLog | 10 ++++++++++ gdb/solib.c | 8 ++++++++ gdb/symfile.c | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+) -- 2.19.2