From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id r7YSFP4/5Wi4JyMAWB0awg (envelope-from ) for ; Tue, 07 Oct 2025 12:29:50 -0400 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=G5LUX1bC; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3C02F1E047; Tue, 07 Oct 2025 12:29:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 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_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 8CB6F1E047 for ; Tue, 07 Oct 2025 12:29:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D2F73858C60 for ; Tue, 7 Oct 2025 16:29:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D2F73858C60 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=G5LUX1bC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 318B33858CD1 for ; Tue, 7 Oct 2025 16:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 318B33858CD1 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 318B33858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759854544; cv=none; b=xLjBzH0lg0fi398CI9v45kMszdHoS/0MSa2JNXFnRbjvf99rTXUmWXTPNT/shbKQ3t0DutzegtiXfI1dlbar8IaP193iZAsogpMAwayV2URcUOeO6gFGI0OmUaQrEURDA3Yw2fyEIT4mrPeVLbXqqcaBLoEneWtbV3VF7Ak7CLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759854544; c=relaxed/simple; bh=YvNmba/bgS/GS9Cu0FYjJuDpmUCgfWMD9QhYqjZbKTY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LmPv8zqSFp0PYMrk2mb4jX0UqJb/mR2iHcBgCcVBLP3h2PXJXV3hWrdlsLjhEO9bD2T55t273fadjInY6rKlFatqKSNRQtWr0zxxXscWLwzVmi6wTA1vf0iEEUkKtcAHJdZj7ZYNj9FEzzLjeVVvTMKueC1hVFO7K+nYV9UVxOo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 318B33858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759854539; 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: in-reply-to:in-reply-to:references:references; bh=NhwHspnUJ8q0UoINAl73m22Whqdin2SwgouzwEMAqxM=; b=G5LUX1bCquXRr/pl5+DDDf1O8ILUC6xrx9Xf7EW9iS750oc9qit87MUkwv1flidwWVktTR jOVgo0771KmOWyOEeEHNPFYFHl66UxuIWJAtos7fWPWOH1dYFxUXUa1w7gB3Ub2cyEbVd4 SyHZ6NHlutFeepQS1QfQiT4922TOAE0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-nVGh-nJEMlqFzXjsN5YWtA-1; Tue, 07 Oct 2025 12:28:57 -0400 X-MC-Unique: nVGh-nJEMlqFzXjsN5YWtA-1 X-Mimecast-MFC-AGG-ID: nVGh-nJEMlqFzXjsN5YWtA_1759854537 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-46e36686ca1so62851645e9.2 for ; Tue, 07 Oct 2025 09:28:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759854537; x=1760459337; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NhwHspnUJ8q0UoINAl73m22Whqdin2SwgouzwEMAqxM=; b=pkls2tfLqLluT6fWrzQsy3mtmrM5c0K0E/RnqUCpUZvCx4eAjCLh1wsc872rrwZgwI BXfftQ5KqNDa1XTJafUsLrcF/JrNo0zuYqQLURTt+52cZnyeeOIEcYdGdEkPXIkvBQJT pcyXPe6UYPGbpu4Zo9weu2J0jUYDUDm/bwrBJ7ITa34YgRuv4g2GQQOhN54uQ8wfxvfT HJnOjvIuWKNVGlbj9Z6XXqVFPkTdgqV+YKuHow+jXnuP/CzgChBdryTR1Jr461qRXi0E rWM5D2piURwK9tVZTwzFv4Vah5k6BASLerxwdLK12FdIdwHBy05YwRT9R4Ailyf+kcIb svDw== X-Gm-Message-State: AOJu0YxP4+VtX8y1XosxoDV82vL6BleC+kf2xDMhOGpKsCFYjpXEa8uO YhfJPmJdkUotvrnD+Q3dLo7cLY6e7QOgWnUFmiSW2NCyRLF22x3U85SWk0TwLuXhA9bAweWTplf t+778HBFCXyrHjfYEhGslAUIgjEO5YyDdGaasPjcq3myVcHSlG2QXf6PkyuQdWvo= X-Gm-Gg: ASbGncuQhTXbvFUa90wUJuLwWbpjjxtWM1it0ixldPLEajbw2krNvsELJtYENBvAJjI 3Gqf+QvuwJrL+Hq/JnD7pxtLho4e/wFFuNOly/pX4gRSNqTpbiY6ubs1AoD17VZMTZDhhNCUBAE CEml8OtNgBXXerL30oQEgjIg6U+Je4inzcKSsSP2uIcmOlyNW2hkK1x/ChWies049oIOxQ/xyp6 8rxrAk9WqE64Q2w6/+IHwQD71e4jJAiErc+uIc6X27CYI/Wh75yW3wBDnLU6eSdhCPj1RYntLIR Ov1MFkLDSzaOFp+AlYCqnt/k+Si9UhutIkAswC9z X-Received: by 2002:a05:600c:1e28:b0:46e:394b:4991 with SMTP id 5b1f17b1804b1-46fa9aa0e3amr1793535e9.11.1759854536607; Tue, 07 Oct 2025 09:28:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGK16ylqE1HSzuZwm211xLc8Py+09kXivIV3p41NmARJF6/rKcW0jPoZCFOqOPHO5ueCtCBg== X-Received: by 2002:a05:600c:1e28:b0:46e:394b:4991 with SMTP id 5b1f17b1804b1-46fa9aa0e3amr1793315e9.11.1759854536168; Tue, 07 Oct 2025 09:28:56 -0700 (PDT) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fa9c07cbasm1117295e9.7.2025.10.07.09.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 09:28:55 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCHv2 3/3] gdb/python: add Corefile.mapped_files method In-Reply-To: <3996ddc9-2cb4-4ead-8895-5d6b27b5a72c@suse.de> References: <9ab589510f784da2752b72d0b1385afa33aca406.1758634958.git.aburgess@redhat.com> <87cy737q50.fsf@tromey.com> <87zfa26gxp.fsf@redhat.com> <87o6qi6dwn.fsf@redhat.com> <87jz166al5.fsf@redhat.com> <3996ddc9-2cb4-4ead-8895-5d6b27b5a72c@suse.de> Date: Tue, 07 Oct 2025 17:28:55 +0100 Message-ID: <87bjmi65h4.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: oZn3_mFFamdtJe1Nk1wghrM3ew46q7djw-pRDuYATbY_1759854537 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Tom de Vries writes: > On 10/7/25 16:38, Andrew Burgess wrote: >> Andrew Burgess writes: >> >>> >>> Thanks for the diagnostic help. I'll work on improving the test to try >>> and catch these cases. If that works, then we might be able to adopt >>> this to help with other tests. Keeping this in mind, I'll add helper >>> functions to lib/gdb.exp. >> >> Hi Tom, >> >> At your leisure, could you check that the patch below resolves the FAIL >> you reported please. >> > > Hi Andrew, > > on Leap 15.6, yes. > > On Tumbleweed, unfortunately no. > (gdb) PASS: gdb.python/py-corefile.exp: test mapped files data: capture Python based mappings data > shell diff -s /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-1.txt /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-2.txt > Files /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-1.txt and /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-2.txt are identical > (gdb) PASS: gdb.python/py-corefile.exp: test mapped files data: diff input and output one > show-build-ids > Objfile Build-Id Core File Build-Id File Name > 91c6abb593a519ecd18e543eaac25f913999b230 91c6abb593a519ecd18e543eaac25f913999b230 /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile > Python Exception : 'corefile' > Error occurred in Python: 'corefile' It looks like there's an objfile discovered via Inferior.progspace.objfiles(), which doesn't correspond to a file mapped into the core file. FYI, I only consider objfiles that are _actual_ files, so ignore things like [vdso], etc, and I only consider objfiles with a build-id. I figured that everything meeting this specification had to be something that would appear in the core file... The patch below will make the show-build-ids command a little more resilient, when a file is missing it'll print "missing" in the column now, rather than throwing the KeyError. My guess is we'll find the same file under different names maybe? Thanks, Andrew --- diff --git i/gdb/testsuite/gdb.python/py-corefile.py w/gdb/testsuite/gdb.python/py-corefile.py index 5c8ee7b2f0c..01665ef0395 100644 --- i/gdb/testsuite/gdb.python/py-corefile.py +++ w/gdb/testsuite/gdb.python/py-corefile.py @@ -110,7 +110,7 @@ class ShowBuildIds(gdb.Command): continue p = pathlib.Path(o.filename).resolve() b = o.build_id - path_to_build_id[p] = {"objfile": b} + path_to_build_id[p] = {"objfile": b, "corefile": "missing" } if len(b) > longest_build_id: longest_build_id = len(b) @@ -125,6 +125,8 @@ class ShowBuildIds(gdb.Command): if p in path_to_build_id: path_to_build_id[p]["corefile"] = b + else: + path_to_build_id[p] = {"objfile": "missing", "corefile": b } format_str = ( "%-" + str(longest_build_id) + "s %-" + str(longest_build_id) + "s %s"