From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104469 invoked by alias); 9 Nov 2018 23:32:17 -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 104437 invoked by uid 89); 9 Nov 2018 23:32:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=day X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 23:32:14 +0000 Received: by mail-wr1-f67.google.com with SMTP id i17-v6so3516426wre.7 for ; Fri, 09 Nov 2018 15:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo-io.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hRgtlSNL02kzcde5svaBDSsf9YL8wKRXXPX+5PFB/Ao=; b=B2LXl2gjy6dxKpBCgl3KW4LRV9UmO5CBeD4hrCaSEBkZOwZlQ0usxieunC968sic53 jdtxMl/ZX8UfGE4v3uFdAwcd5W32nZiNRvYNaVAkKnCemTLcX1vQPzQvqaehNIJPaeFA S2Aal1PC0OAFiEjJTeXZ9yWBdMgHQCNXKZMviuUkcPckgWR6VJsR4fwvQxx6tUQ7jBZn Ir7gF4XrCphNCnSfc/S8cSDt9CET1miv6K1cpfRWkPlzVFOXoHyjuFpl9c2Kf9TLE7FK LWYdI2Qc1I4wmeKm+7uF3DiYyLwfdHhIZKGGnZvqc+6y0p/55W4c59v/DkS+yuu2KqGi uTTg== Return-Path: Received: from undo-autkin ([109.159.206.110]) by smtp.gmail.com with ESMTPSA id c14-v6sm3685665wmh.44.2018.11.09.15.32.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 15:32:11 -0800 (PST) Date: Fri, 09 Nov 2018 23:32:00 -0000 From: Andrey Utkin To: John Baldwin Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix search of debug files for remote debuggee Message-ID: <20181109233210.GA27477@undo-autkin> References: <20181109190940.22554-1-autkin@undo.io> <10046787-753c-f7e0-4386-2b50086ae530@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10046787-753c-f7e0-4386-2b50086ae530@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00185.txt.bz2 On Fri, Nov 09, 2018 at 11:42:25AM -0800, John Baldwin wrote: > Now there are debug symbols for the various base OS libraries and binaries > installed in the sysroot at /ufs/riscv64/rootfs/usr/lib/debug. For example, > FreeBSD's libc is installed as /lib/libc.so.7 under the sysroot > (/ufs/riscv64/lib/libc.so.7) and the debug info is stored at /usr/lib/debug > under the sysroot (/ufs/riscv64/usr/lib/debug/lib/libc.so.7.debug). However, > GDB places the sysroot after the debug prefix and ends up looking for > /usr/lib/debug/ufs/riscv64/lib/libc.so.7 on the host instead. I usually > work around this by creating a symlink from /usr/lib/debug/ufs/riscv64 to > /ufs/riscv64/usr/lib/debug, but it seems like a bug to me that the we don't > look for debug files "under" the sysroot. > > I bring this up because I wonder if a more general solution of always putting > the sysroot before the debug prefix (e.g. "/usr/lib/debug") wouldn't fix > both your case and mine. It's not clear to me what the "correct" behavior > is for mixing sysroot with separate debug files. It may be that the current > behavior of // is intentional rather than > the // behavior that I would like (and that > I think your use case also wants). I see what you mean. Your intention makes sense, but since GDB does not assume your case out of the box, I guess set debug-file-directory /ufs/riscv64/usr/lib/debug should just work for you? >From code I see that GDB checks quite a few places for debug files, maybe some day it would check also where you want.