From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 6A59E388206F for ; Fri, 14 Jun 2024 14:24:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A59E388206F 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 6A59E388206F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718375041; cv=none; b=HCxcrjlWnvYNI2DuumhCCvnevsQQCqBYvru3yUtknJWUBme69FD1KuEbDuOkLtc3q3XGuCFs3YSpl4o2kHn2oH2IVkAg7g9e2h+6AdrnlMRceEqF1j90aLevrfGiFxi3F03xNqcpD6VXvhf47ydQAxMNX4fqRCOZJy8SNDxGjf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718375041; c=relaxed/simple; bh=5QooAJfkn4JMdHXR9xaJ0kaRpdvEbWsbOxvDgZ72AVc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=G0p5DPyhQ4b0ssGspOLaD7YBTYc3SzD3UIpSez+gab+/eFN7DsgL+CqCJm7Bqz6RFIRUebtBoM3JYHax7KZK5v2Wd76v+CT30YnqwrCfwAP1GybGfJIBIIMSnSi01nv2mG5AhBR9n+HAKy4TNbKiREX75C9JVVwNbsvTEOh8WBY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5003a.ext.cloudfilter.net ([10.0.29.159]) by cmsmtp with ESMTPS id I6zts6exhAidII7qSssQp4; Fri, 14 Jun 2024 14:24:00 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id I7qRsf7JusT9BI7qRsJ7fc; Fri, 14 Jun 2024 14:23:59 +0000 X-Authority-Analysis: v=2.4 cv=LIutQ4W9 c=1 sm=1 tr=0 ts=666c527f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=T1WGqf2p2xoA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=q7Ysj2x2wjVdRzoEgs4A:9 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:Date:References:In-Reply-To :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=mya02rYLI2npRQjWXumniRyokcubC8QXCLXHt53OidI=; b=YsVKFmdgjeNYkda4qrpKhF3zPF WD4XHm+jpH40HQ8NeNLDQEPbCk+xHTLSzrLmJG91lBOoe7tpLvkbGFjq+Riu4bTlvkJ4eNvjjvUuX BVSjT190tpfIMRBWNaNTHXu54; Received: from 75-166-134-4.hlrn.qwest.net ([75.166.134.4]:57504 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1sI7qR-002la5-0I; Fri, 14 Jun 2024 08:23:59 -0600 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] gdb: avoid '//' in filenames when searching for debuginfo In-Reply-To: <87msnn99zy.fsf@redhat.com> (Andrew Burgess's message of "Fri, 14 Jun 2024 09:58:09 +0100") References: <70fd0861b081eafbc89738a7e2582652d2d074fa.1718272366.git.aburgess@redhat.com> <87cyokeqoo.fsf@tromey.com> <87msnn99zy.fsf@redhat.com> X-Attribution: Tom Date: Fri, 14 Jun 2024 08:23:58 -0600 Message-ID: <87sexfd2m9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 75.166.134.4 X-Source-L: No X-Exim-ID: 1sI7qR-002la5-0I X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-134-4.hlrn.qwest.net (murgatroyd) [75.166.134.4]:57504 X-Source-Auth: tom+tromey.com X-Email-Count: 12 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCB63XjHowAvBooxLqgwvuvDX5rRMJY1ENu87xCT+2SuAg0Zt1KRugGYSm4+zvsRl5uhqezrGK7nlqgGhoLOS0Ef9vG39090xAzDBJgHz37jkCUgJHvT WVgoUSow0/7XiZ+TqkzDXafSAo0wqRMTFycgcaI/0EAetNj2J8Ioleqo6cEXvAc1FVa3aniRRwjy/NcT61BYQ2lsUZCs45HCDCc= X-Spam-Status: No, score=-3014.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,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: >>>>> "Andrew" == Andrew Burgess writes: Andrew> You're absolutely right. And I see what's happened. Somewhere along Andrew> the line the logic has gotten reversed in my head. The problem isn't Andrew> that the first _must_ be absolute with path_join, it's that everything Andrew> else _must_not_ be absolute, see these lines in path_join: Andrew> if (i > 0) Andrew> gdb_assert (strlen (path) == 0 || !IS_ABSOLUTE_PATH (path)); Andrew> And for what we're doing here we, for example, join the path to the file Andrew> (which is absolute) onto the debug directory, which might, or might not, Andrew> be absolute, e.g. these lines in find_separate_debug_file: I'm sorry to go around on this again, but what if we just remove this restriction from path_join? It seems to me that removing an assertion can't break any existing callers, and it's fairly normal in other code bases for path-joining to work this way (that is, an absolute path causes a "start over"). Tom