From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7h3wLetO8Wh6fzkAWB0awg (envelope-from ) for ; Thu, 16 Oct 2025 16:00:43 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=N0M+9R+6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AA1011E0BA; Thu, 16 Oct 2025 16:00:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 9EBE31E047 for ; Thu, 16 Oct 2025 16:00:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12F3A3858031 for ; Thu, 16 Oct 2025 20:00:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12F3A3858031 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=N0M+9R+6 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 85C233858D1E for ; Thu, 16 Oct 2025 20:00:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85C233858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 85C233858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760644811; cv=none; b=skjTG0ycX3/ka+RiwDVZJa9quvdhcZF1QVtAg4ptHhXKLm0Uq6zUfCfJWMPlN0sd3KtBFAS9DIu1zI6VSMlt/VAXHRtLZxmVGq2+JN9ORUFl/go9CV7nR4xJuNphgGhP4livGiXW5k9SnA45IQgigS12owl8nQROOEjqc5eo/AY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760644811; c=relaxed/simple; bh=mMpaTAI7LAcgd0L/hX3nRhgSs4+ty5txvKTAc4/B32U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZCytrOAeCDaYvCVdqXXIC6UaWC69jDmfOIVvv3thOvP/O7uuAPjiwypZ/O8l0JRaa17//ZqtO4zocokT0TxixHZsGB8DiC2zNf9UWWNv5GFN/9IVbtXPH3g9RsWmOZ0bw4Qf+fCk3jMh9ziVFFKFiT5rbMONz775myoHNa9UYuU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85C233858D1E Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-92c781fd73aso120073039f.1 for ; Thu, 16 Oct 2025 13:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1760644811; x=1761249611; darn=sourceware.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ze+M6J2odN/WvEZAZMA7/dU6Wz0nGpOA3j4sdo3g/kg=; b=N0M+9R+6lFqED/Sy3WeGI7Nqh/E/LVtngjVTBn0Zvf6SFFHPqIcGJ1IVah5cKIZ+9P SgodZ83KFurKBMeKfTwGMJkw7HnAUozpnVqfyhZgv59fV1LDIdFWKJfh8ShLSDQXW5Ne 5fv6e207E4qya9btQhgSWPb9//3VjTjRvEmWP7j5WtaZr86Av9qCnQZ1Sw/vtICGgC89 ppSczJ2xgsA39/cGuaDoCn3RdIx/F7hzRVtgCa69EhvsCPgPybj5Qi+QyZjvU1YQaN5F uK5m2Gmj9F+4RIDbtVA6iRYuMBG3TOQG6XYcEkYgUvjptJ6nxkP7E6xljQB4rG5+TYTx sBKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760644811; x=1761249611; h=mime-version:user-agent: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=ze+M6J2odN/WvEZAZMA7/dU6Wz0nGpOA3j4sdo3g/kg=; b=boMeKT8O0MSozcWKGGCPSYylIIlxz0Umt0rH/HCbM1kP8lLFs75/pex7Xq+anxOb0p VIBHn8vaAvLBKdLra8h+vyWkvRS+Og5/LBxD7maWm437DJvFz2XmTxh5lnOZL56Kbhfc c8KO6wlx4qmOjg4wc9BotbEzaM0RWOjInjBGcMwVzTd4qxJ/cen6ohL57JL1pt7OtHtk gdckusgKmtWEnLeoxBTf76sIABggajTta9dz8oO8vkp91g/bMrXGb2vaMpixFTnKL7Yh KKOZpBNcoCUTPFTy3S8vGaoAhw8cASYbJNq0zuTEGwT5YPj0r7BvnNZujdPNe+Gb9nu9 TldA== X-Forwarded-Encrypted: i=1; AJvYcCVGn8orUw1r4Zdgcza7dj3PgTx+X0vYmgjXOCnL/AXPBnNdou0p9NRHa9sd6WepArnsUs5g3nJ76DbGiA==@sourceware.org X-Gm-Message-State: AOJu0Yza1NC5eS+YAphAEU5OgPjjPXa3RJx/IUUlAKPuwoQqZrdFQKIp /HHrikPuOCIY8VEtnRIrvxDt9Bgb2qj6hVqaaclHXzw7NbKpkT4PQOexpdQlHW/kwg== X-Gm-Gg: ASbGncvcHFmhtPZC/OerPauqMhsypWV+PFrVKuVfyrHAoy24OV9izfyX7MfHJ1H/v0K I55Z4gLO2wVW71tqH9xQLIMfcrOwnxlRc33P/xTbY/KLK6Niu1Hnu7yLMU5i7k7aEm1NwhhQ9Tr Qx1fDBI8UUPBIF9E1sqkCQr+UjGR/r/4hvh8+thTNyf56bcbNI1MdiSn8lQkBFfAPCUXxGk3iD2 WPaCmcnV+zK0k+2+LuiDGlrROzaEKwFfwidRkH2aHg4GEGW0y7+VUl9SboamUM9d8kclkMSNIae 8qzJVz+4PMSXKGVhr2YTmJaj5HvQprVuV1dkB6CvcMN1SPyPnIbdizCb+1VYQrKv0JW/d9ktMrd ynWpwd2kv8OR+PzJr5wAc6QDE2oFrMVo1uJgfAPwntlACX+/KOifGsI1zQX0RxY+nntaInyMltD GhgZxc2hrGhuWm9RYcoS8= X-Google-Smtp-Source: AGHT+IHwPstfyceq15+0kFH7WEFIQG9MsFIrgBtJvku8hXoZm5ONZAwKE50BGB29xEhTeEBm2PYzfw== X-Received: by 2002:a05:6e02:1a65:b0:430:c323:2bca with SMTP id e9e14a558f8ab-430c5223f38mr22009165ab.10.1760644808619; Thu, 16 Oct 2025 13:00:08 -0700 (PDT) Received: from bapiya (97-122-110-68.hlrn.qwest.net. [97.122.110.68]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-430b512c2ccsm14641945ab.23.2025.10.16.13.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Oct 2025 13:00:08 -0700 (PDT) From: Tom Tromey To: Andrew Burgess Cc: Tom de Vries , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCHv2 3/3] gdb/python: add Corefile.mapped_files method In-Reply-To: <87zfa26gxp.fsf@redhat.com> (Andrew Burgess's message of "Tue, 07 Oct 2025 13:21:22 +0100") References: <9ab589510f784da2752b72d0b1385afa33aca406.1758634958.git.aburgess@redhat.com> <87cy737q50.fsf@tromey.com> <87zfa26gxp.fsf@redhat.com> X-Attribution: Tom Date: Thu, 16 Oct 2025 14:00:07 -0600 Message-ID: <87o6q6r514.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 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 >>>>> "Andrew" == Andrew Burgess writes: Andrew> + Build-id is not present in the core file, GDB will return None for Andrew> the build-id. Andrew> Of these two I suspect the second; for a period of time the GNU linker Andrew> was ... changed ... such that it no longer placed the build-id within Andrew> the first page of a generated ELF, as a result, the Linux kernel would Andrew> not include the build-id in core dumps. Andrew> We can check for the second case using: Andrew> readelf -WS /lib64/libc.so.6 | grep build-id Andrew> The output will be something like: Andrew> [ 2] .note.gnu.build-id NOTE 0000000000000370 000370 000024 00 A 0 0 4 Andrew> It's the '000370' column we're interested in. If this value is greater Andrew> than a page size, then GDB isn't going to be able to find the build-id. I have a question about this work. There's an internal AdaCore test that creates a core file, then uses 'file' on a different executable and 'core' to check if a warning is issued. gdb 16 on this test does: (gdb) core core warning: core file may not match specified executable file. [...] However with git master we don't get that. Now, the executables in question do have build ids: bapiya. readelf -WS call_crash|grep build-id [ 2] .note.gnu.build-id NOTE 0000000000000390 000390 000024 00 A 0 0 4 bapiya. readelf -WS crash|grep build-id [ 2] .note.gnu.build-id NOTE 0000000000000390 000390 000024 00 A 0 0 4 ... and I verified the the IDs are actually different. I'm not really sure how to find the relevant page size, per your comment above. I can't readily tell if the core file has an ID. gdb thinks there isn't, using the command from py-corefile.py. That by itself seems a little weird but I am wondering if the warning should appear anyway, at least in this case, because the core file records it was created by 'crash' but the current file has a different base name ("call_crash"). IOW, is the lack of a warning in this case now intentional? And, how can I understand why the ID isn't in the core? I'm having some trouble figuring out which 'ld' the compiler is invoking. Tom