From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id thrdJo6GMmn5IhoAWB0awg (envelope-from ) for ; Fri, 05 Dec 2025 02:15:26 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=WiD4PwlD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9044F1E048; Fri, 05 Dec 2025 02:15:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B1D741E048 for ; Fri, 05 Dec 2025 02:15:25 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C5234C3188E for ; Fri, 5 Dec 2025 07:15:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C5234C3188E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=WiD4PwlD Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id A99564C31870 for ; Fri, 5 Dec 2025 07:14:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A99564C31870 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A99564C31870 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.51.188.92 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764918884; cv=none; b=eivIi8q/l2elOp3yR9sSMGAjkpwp7za+Sgv5tvRjlKtdCG/10NIkOLjby/P0JqHKNHkjBq5k0ZQrDrTLOfUFqRZagDpgXKeB31pWK6NKpTsVQjoRL0bEP66JXjSVsSPUdCYrhlg2pxKI0VgRrtbKb0cw7xDwjyq1IYiuZ1HxOrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764918884; c=relaxed/simple; bh=vNEaTlCv8J+scs4Yjhb0LSQpGgORRhq3hiLEHmRwN9M=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=loqE+dNIlqsGwW7gnKHjqRRSQ0PvoST9xmzp1wxC9532gpZGW4NhXeBGNwCqQnG0M6b7PPIwsIg8lAOs0XOGFL8I2pP8BnhLX0Ygti/C6FlrR0AWL2gPw9bJKf4MEg2uHL95EACkYs0jIpd4beetVlxbjl0bikPhR3i6JX5OU0Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A99564C31870 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vRQ1c-0004na-0c; Fri, 05 Dec 2025 02:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aJTduREqtsNHULP2Mzv16A2yWv3EgyAkryDu+iFdXZA=; b=WiD4PwlDlkNM LJieRXdA+1exgFZWoZFm/NeZzt/PsWYRaL/BYQIL5FQXNHodbbPw6rQSQO02bAM2cjvLdd6cbqeg0 JzJGaGSyGjL3Qpvk4mP+D+S1SwNTex4DKNcqDZTO+jo0LT3bcHQNWlL1C01f3CC5Qlm4On+SY8ikk UavBE3OeoMwi1WbFhGo5pJlIN4TjUbSmwR1FB+zPG+gHZQQ32cjn5fxy3DPHa7SWlsF/nnbdhl119 YsMroKnUOfwnWIIQ6CF2Spf5Eydxvw0gfqqHOcj+F4zvFOvGjpVx+QRAKOBvtdwWQaIPJAO2vLGiE 6em9HrrOjyC9FH3yVI7skg==; Date: Fri, 05 Dec 2025 09:14:41 +0200 Message-Id: <86ikelz9ge.fsf@gnu.org> From: Eli Zaretskii To: Kevin Buettner Cc: aburgess@redhat.com, gdb-patches@sourceware.org In-Reply-To: <20251204131835.289e5644@f41-zbm-amd> (message from Kevin Buettner on Thu, 4 Dec 2025 13:18:35 -0700) Subject: Re: [PATCHv2 1/2] gdb: fix 'list' for multiple source file results References: <20251204131835.289e5644@f41-zbm-amd> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > Date: Thu, 4 Dec 2025 13:18:35 -0700 > From: Kevin Buettner > Cc: gdb-patches@sourceware.org > > On Wed, 19 Nov 2025 10:32:37 +0000 > Andrew Burgess wrote: > > > From: Andrew Burgess > > To: gdb-patches@sourceware.org > > Cc: Andrew Burgess > > Subject: [PATCHv2 1/2] gdb: fix 'list' for multiple source file results > > Date: Wed, 19 Nov 2025 10:32:37 +0000 > > > > This commit: > > > > commit c7a45b98a61451f05ff654c4fb72a9c9cb2fba36 > > Date: Thu Jun 12 15:37:50 2025 +0000 > > > > gdb, linespec: avoid multiple locations with same PC > > > > broke GDB's ability to list multiple source files using a 'list' > > command. In GDB 16 and earlier something like 'list foo.c:10' could > > print multiple results if there were multiple 'foo.c' files compiled > > into the executable. > > > > The above commit added a filter to add_sal_to_sals (linespec.c) such > > that multiple sals in the same program space, but with the same pc > > value, could not be added, only the first sal would actually be > > recorded. The problem with this is that add_sal_to_sals is used from > > decode_digits_list_mode (also linespec.c) where the pc value is forced > > to zero. This force to zero makes sense I think as there might not be > > any compiled code for the requested line (this is for 'list' after > > all), so there might not be a valid pc to use. > > > > I'm not a fan of using '0' as a special pc value, there are embedded > > targets where 0 is a valid pc value, but given we're already using 0 > > here, I propose to just roll with it. > > > > So, my proposal is that, if the pc is 0, add_sal_to_sals should always > > add the sal. This fixes the decode_digits_list_mode, but should keep > > the fix that c7a45b98a614 introduced. > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33647 > > --- > > gdb/linespec.c | 15 ++- > > gdb/testsuite/gdb.base/list-multi-source.c | 60 +++++++++ > > gdb/testsuite/gdb.base/list-multi-source.exp | 129 +++++++++++++++++++ > > 3 files changed, 199 insertions(+), 5 deletions(-) > > create mode 100644 gdb/testsuite/gdb.base/list-multi-source.c > > create mode 100644 gdb/testsuite/gdb.base/list-multi-source.exp > > LGTM, also. I, too, think it should go into 17. I agree that the fix should go into GDB 17, because otherwise it will be a bad regression.