From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id E3D7538582B4 for ; Sun, 10 Dec 2023 23:11:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3D7538582B4 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E3D7538582B4 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702249889; cv=none; b=fvj6enq2raCLkrUsnSrsGJ4GQtsIEMIhv7DDLeg0sezzejO+5RSuCGDfpWf9yHCdVE7flG2Um3rZ7tH3rFIlklS09M6cYWdjLyhplp4w8qfy1SlOyQTTTLxj7Zo9UHliDXILPRfq4jyC4c0tTd9k9KAN+8UEajUY+5SIR0IMwis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702249889; c=relaxed/simple; bh=FQn5lxcBOseBJ6HZw34/SMlDHkSk63Mh6XaNAftZut8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jBCoZR7ZVF5rhbFYGKnbC7m9icC5gX7FA3Y9vfTZDSXEgCZPAncPKpTqiiYdWuPJs1zY4WhgmpZdMB2qZ8khTmfT0Bj8DQsfmHW2jXgB0Cvp/usrcFYlG/N+a9Y8F9+P6XNBKS3moxSV8SmZIk1wzqv3lJShfGo4phSQuJ8C27Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id COB7r5MaT8HteCSxKr9qQc; Sun, 10 Dec 2023 23:11:26 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id CSxJrFrbzRGmSCSxJrstu5; Sun, 10 Dec 2023 23:11:25 +0000 X-Authority-Analysis: v=2.4 cv=efcuwpIH c=1 sm=1 tr=0 ts=6576459d a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=e3Ad-NnKgyQc93v2h3wA:9 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pnJkYQnKc0MISKuU0v4790HTMHLb9/C9IiIXe7dQz0c=; b=dIgj/DhBL0679uixnd9jh/NMms X1TLHtYovwYgvtkTug9wdE5nKAaiH3WkF2fFTuJVxlBGTf8q78MKpFK9Urq2yo+EgzuRH1fcYypgC Y/jF/U19CBAd/620Pm9zApPhx; Received: from [198.59.47.65] (port=46490 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rCSxJ-001Qsj-0V; Sun, 10 Dec 2023 16:11:25 -0700 From: Tom Tromey To: Mike Tsai via Gdb Cc: Mike Tsai Subject: Re: set sysroot and debug-file-directory don't work together? References: X-Attribution: Tom Date: Sun, 10 Dec 2023 16:11:23 -0700 In-Reply-To: (Mike Tsai via Gdb's message of "Mon, 27 Nov 2023 12:55:19 -0800") Message-ID: <87zfyh64bo.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 198.59.47.65 X-Source-L: No X-Exim-ID: 1rCSxJ-001Qsj-0V X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel) [198.59.47.65]:46490 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfENCAb9Pw9Y1f+Kn8n5Bu8yZ2qsadZ7StmkQxpBxvQvAa2GjyLunE87lscbctTWcy7Iog4K0sYe1/wEiy74GtbwPAvDpjeYBGg8H0NpNAM8qzN80qzq0 jB+nFAF136tnQH1j7pVwg0FN7abiBfsOf/FbWr4Wq06n1ZF4rGVb8ETEx4bm9iMWmSq16S1UEp2Z8Q== X-Spam-Status: No, score=-3017.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Mike" == Mike Tsai via Gdb writes: Mike> I have a dummy question regarding using "set sysroot LOCAL_DIR" and Mike> "set debug-file-directory SOME_OTHER_DIR" together to find symbols for Mike> a debug session. I was under the impression, gdb is able to fallback Mike> to debug-file-directory and do build-id style lookup if symbols cannot Mike> be found in "sysroot", but it does not seem to be doing that so I am Mike> curious if it's I am doing something wrong or this is not "supported". I didn't know the answer either, so I looked through the source a bit. In the end it's just a pain to try to figure out what this code is doing. Far easier, probably, is for you to: set debug separate-debug-file 1 ... and then try. I think that will show exactly the paths gdb is trying to use. I tried it with "file /bin/ls": (gdb) file /bin/ls Reading symbols from /bin/ls... Looking for separate debug info (build-id) for /usr/bin/ls Trying /usr/lib/debug/.build-id/a1/46002a40b622e4d8420c5b96513f0784c8eb7b.debug... no, unable to compute real path Trying target:/usr/lib/debug/.build-id/a1/46002a40b622e4d8420c5b96513f0784c8eb7b.debug... no, unable to open. Looking for separate debug info (debug link) for /usr/bin/ls Trying /usr/bin/ls-9.1-12.fc38.x86_64.debug... no, unable to open. Trying /usr/bin/.debug/ls-9.1-12.fc38.x86_64.debug... no, unable to open. Trying /usr/lib/debug//usr/bin/ls-9.1-12.fc38.x86_64.debug... no, unable to open. Reading symbols from .gnu_debugdata for /usr/bin/ls... (No debugging symbols found in .gnu_debugdata for /usr/bin/ls) ... IMO pretty readable. If I "set sysroot /tmp/nonesuch" first, then only that "target:" line changes. This order seems sort of backward to me somehow, like if I had a complete sysroot setup (including all separate debug files), then "set sysroot" should be sufficient and it should never check outside. I suppose with .build-id the idea is that the hashes are global and so it doesn't matter exactly where gdb finds the match. Tom