From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 02E5B3858D1E for ; Thu, 22 Dec 2022 19:32:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 02E5B3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4NdL6n2MdJz3kmq; Thu, 22 Dec 2022 19:32:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NdL6n1Xr7z4LnN; Thu, 22 Dec 2022 19:32:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671737537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ydtrj3Li6n86ETByS6Adscf3ycDsAIZ8AgZZOsN3zyM=; b=UOu3UvtShj236qFST8/xrUte4y8RVw9t7Pf3cQeKebZ2wsmZWSyOfYY2wOWhD3O28mW3H+ LpuEk5ezvX4ZL1DvsXVt52ke4P7vapbuzRvfapJT+2KU3NmyOZHO8266z0iDPbBqnq1BqE lsbikPYp+KWKm9YMLXtDVF6/eW6PBrn8EVF5FOm8bHFcSuhS+EZEAjIf3imHx/NOOPid2/ XJgc9R/jt6vl4RBA1EjDmuz75+qCERLm8zGcv+d5W48V9/PTSw5ioL6ylJQmK0fhIJoNRd CcsVCNfI2WzWNK2cSP1mJAcQGobGE8E1txZAl15rlh+cr0H/bpgmuSlUyYQyAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671737537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ydtrj3Li6n86ETByS6Adscf3ycDsAIZ8AgZZOsN3zyM=; b=ZmktY/LbUIxvCoMf0NzsWAoDJB5yTKUFilz6UeWVsYSH5wH6pc55GfhCmBSCYtGyfeB1WN MlXqYDFr0dQSQb6i1YYYuL0MbF9HvORlFX0ryPqBI4kVMi05vpOuBzsoq78i8BzSwa6v7x nsrSSSiwQhY67I2a/ZfhuoFc4DzpFucppyMjmxbg50TboWz/teub1zoUbs2fdTVXmUzyFY mmRJJvIo6VpQjMDLzgB8IXW0f7ccc+DNGf+ylza7xFeIQ44jfmiWB9WoC7PYXI6k4vBOYN EBHM7Qv4W9JIsHNdXk8ASDxA0/b38gG1AJIkEHykvC5RbQwkAJMtD0SvSBv6Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671737537; a=rsa-sha256; cv=none; b=U4wqZDgpPmBwEbfzQIrmx2R4sN2bwgL9NJdMLCw/5fWvvey5VfM+qAld7iMrFnudd29n63 4IpjO2k7SSFH2pWVJs4+eek7bbvBV5rIPSWHLOdrSrXgrelD2nCwLODXGzfpqHSG/5/VVf XW+mlfodTsWQUZTMwgb0c/W8NzFtWdhhx6mh/GnBy0NfNKi87zff33DJlIHQWfuDo5Bpku t0xtgKjo9EOiCFTQ8nXvuIu6HpelP+A9PAPV34ss0ESW1okThCgzjVcmyS6P+bunN63hnR Zbz4ytsobvzc4kb0pz7F4RAl82op4atXjDA7Rdvl36Pw99fiK3/SDpAWaAlgdw== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NdL6m61Ktz15nv; Thu, 22 Dec 2022 19:32:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <003d0921-5648-f2b3-1810-34654c9dee62@FreeBSD.org> Date: Thu, 22 Dec 2022 11:32:14 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] Remove target: prefix from gdb_sysroot in find_separate_debug_file Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20221221205958.1102648-1-tromey@adacore.com> From: John Baldwin In-Reply-To: <20221221205958.1102648-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/21/22 12:59 PM, Tom Tromey via Gdb-patches wrote: > I noticed that, when using gdbserver, gdb might print: > > Reading /usr/lib/debug/lib64//libcap.so.2.48-2.48-4.fc36.x86_64.debug from remote target... > Reading target:/usr/lib/debug/lib64//libcap.so.2.48-2.48-4.fc36.x86_64.debug from remote target... > > The second line has the "target:" prefix, but from the code it's clear > that this string is being passed verbatim to gdbserver -- which seems > wrong. > > I filed PR remote/29929 for this. > > The problem here is that find_separate_debug_file uses gdb_sysroot > without checking to see if it starts with the "target:" prefix. This > patch changes this code to be a little more careful. Thanks, LGTM. I added this additional use of gdb_sysroot in 402d2bfec425f29c5b54089d5ff98ca9a1b8ec27 and hadn't realized it could contain a "target:" prefix at the time. -- John Baldwin