From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cidyH7/sMWlOhRkAWB0awg (envelope-from ) for ; Thu, 04 Dec 2025 15:19:11 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J8OZB5ev; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7293B1E08D; Thu, 04 Dec 2025 15:19:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: ** X-Spam-Status: No, score=2.2 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_SBL_CSS,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 E6DDE1E08D for ; Thu, 04 Dec 2025 15:19:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6ADE04B1A361 for ; Thu, 4 Dec 2025 20:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6ADE04B1A361 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J8OZB5ev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4C8AB4BC894A for ; Thu, 4 Dec 2025 20:18:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C8AB4BC894A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4C8AB4BC894A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764879524; cv=none; b=UnFkgtr+S8Gq9b12DilKNiFAeDgaGKyz1KxZ/hjYzPNPMksIB5cmVjo1LkcWQA/w0TfR9GB3P3C1lxGsTw1SuhHkwhv7eyO86JYPv3sGokfdgUCf4bvAKMwcHim+2vTK+a/edRWvVlZL8wV2WwNNHkBd01kb40l2OKWVM+yxvWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764879524; c=relaxed/simple; bh=9bEhaVa6FNb8js6fzUtJRRk8sshNKEIkir0KynGgi+8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=mpQwqq4pSWiaM8RA+Xbfc+9qBnwZNZot9w9EvghvMD8IpzBXHALLs4s+HzLwrEuxGEQMi6CMJz64KITV/whTXI4i0sC/PgmAVvxO2HgL5ZSQEVaKFc286Z5g5ToizFTXJX9EMttlqRBGIPG9jbwtPQtL3G02Ani78TEh2grdSD8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C8AB4BC894A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764879524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PThEeOvi4LORkYT7uxGaDrM0oopnLgODBu2Yicgx9D0=; b=J8OZB5ev4mzjN35Pg757P7G5iHWExwz/xGcIDGHL+y/rhg6MZfhCi4dwlSqmAR0KUXKIcT 1M3edFpAoX514PwjmurGFbKJrAo4egSoChtp09YjGK/Str2fLbLDpUt0onlord4ZoJp9Fn hLdDqZLoEzT1q8fyMtu84taZoNZp2AA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-tCSGWJvTNiidO0DbZ-_1kQ-1; Thu, 04 Dec 2025 15:18:41 -0500 X-MC-Unique: tCSGWJvTNiidO0DbZ-_1kQ-1 X-Mimecast-MFC-AGG-ID: tCSGWJvTNiidO0DbZ-_1kQ_1764879520 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24FFE1956088 for ; Thu, 4 Dec 2025 20:18:40 +0000 (UTC) Received: from f41-zbm-amd (unknown [10.22.66.83]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D9CE51953986; Thu, 4 Dec 2025 20:18:38 +0000 (UTC) Date: Thu, 4 Dec 2025 13:18:35 -0700 From: Kevin Buettner To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCHv2 1/2] gdb: fix 'list' for multiple source file results Message-ID: <20251204131835.289e5644@f41-zbm-amd> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 96_MBSco0ODU8pnqsDTmwelfIqmU8pXjTDdtVnph7rk_1764879520 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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. Reviewed-by: Kevin Buettner