From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1278D3858C78 for ; Sun, 27 Oct 2024 09:11:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1278D3858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 1278D3858C78 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=1730020286; cv=none; b=K3WwMhghTAdWJCRa1je8mZIt8v7BGIqfBVWdOLMd75XYi5r3+VCgCwChGEoWL51Oo4z60m5HVk/L2vMY85b51aurNTo8i9H+aamanv4FEEbi0pjGXXF+nQHWXFBOaDaX6CopT6P04uBd+xCfVS3URcInSVmYMelufVePek29Nmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730020286; c=relaxed/simple; bh=KOfF2M8pKd3Qtv+0gv9Uct+M9IfKdL7B8I83U4WQfE8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=OUpL4YOdhassaQmltD6jxAXdty9KV1wsgiDHyenHvCXOa6MvjKhW9OwYlpdmx7FfPf/PAYciXOJ3oIlQaAW2pgzuEcFkS8RAxs8XpXuD2uY1ZhbkScdpxDYdEppr0GvqHMkXp9mJXkszIfnY/hnH4RW8BXGNKQfMcaLub3mMTOo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730020284; 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=VkDhRdZYwgdIknCyKt9nhPZLRM/ALOPzpD9mpWOlZjk=; b=cB8wY1mLh7meK8Y+I+HMYv9He13cDR43rMoQJijaOMwzWGf1UhQTlI3XsU8ABiK7HmFcsH NeY95Lz2zMw4uV1glsaYqVYt0+fkspXa42E54/KWNPguN9SWeUO+SFywb8/WtT9DgHfeoC Vcswh0yhAr7188zkXYrOOOT+snNuiWk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-jbaGLTfbM52302i0AbSwuQ-1; Sun, 27 Oct 2024 05:11:01 -0400 X-MC-Unique: jbaGLTfbM52302i0AbSwuQ-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-37d4922d8c7so1916890f8f.1 for ; Sun, 27 Oct 2024 02:11:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730020258; x=1730625058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VkDhRdZYwgdIknCyKt9nhPZLRM/ALOPzpD9mpWOlZjk=; b=EeZTXkh5JT01SwTlrDnmvZGV5ZO56hIek0NMVb0DQGH45rO6mEeW0xyfc/bkSSy46V GoIapxqYTDH8IhOXZT9mj/+SR5r8lzizGXKMyddQ0BFY1F9oGBH9wVtquKXlaq7ar6zp XFiinnG4TBleLMLHIyCLDewPekavYuPcvkqEHZ8VFgVot+eHCjs20fp+xCOz3Ksr9CLB epIi1ge0y+5lKVC2vrzWbbDV6bvLMKX1TdxoPZrP3SeD6uP03CAKwFzXOMJcwCwyfOw8 dhQMpYS2cLSZM+J9EbDOoQZH07/pWt2NlfjBTVjaOwkZApHSgJi0gCUwFFML26ZW/lsa nI2w== X-Gm-Message-State: AOJu0YwC7YkJ4I60i4aB/RwFSiuhYo5L6KClMv5Z/qpx7smuXwfixdtX AEh2DLXn2Pg/k6lSxd9RBloD91NeNOcZEZAEk+ep4apu1soKITpMl4WmsYROp2/DI4u6ikAnDVR Os730H59VDCc3XAdNkn7QKs17Vur2Sgrhtva+5VQMcEqrJYScYXolMEtFPYakv4MfitJEphLnSK ti48V+td3PLMGQK5MWvmOiYvw45jBL8cFA1sQzc2gCa3k= X-Received: by 2002:a5d:4acb:0:b0:37d:4fe9:b6a4 with SMTP id ffacd0b85a97d-380611f51e0mr3417150f8f.50.1730020258590; Sun, 27 Oct 2024 02:10:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGniB3pEednCB8cjBvCivGOuuU0JJU9OGbK5B4eW6f/3V+6icr+jEwTda/ROb2/req1QTcvCw== X-Received: by 2002:a5d:4acb:0:b0:37d:4fe9:b6a4 with SMTP id ffacd0b85a97d-380611f51e0mr3417123f8f.50.1730020258083; Sun, 27 Oct 2024 02:10:58 -0700 (PDT) Received: from localhost (197.209.200.146.dyn.plus.net. [146.200.209.197]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b5430absm99808425e9.6.2024.10.27.02.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 02:10:57 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 0/4] Python API to find missing objfiles Date: Sun, 27 Oct 2024 09:10:51 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: In v2: - Addressed Tom's feedback on patch #4. - Rebased onto current HEAD. - Retested. --- This series provides a Python API which can be used to find missing objfiles when opening a core file. This is very similar in spirit to the already existing code that provides a Python API for finding missing debug information. The first patch in this series cleans up the message that debuginfod produces. This is only relevant because the cleanup changes which filenames are passed around, these same filenames are then passed into the new Python API. Patch #2 is a refactoring. Patch #3 adds the new extension language API on the GDB core side. Patch #4 adds the Python side of the same API. For reference, see these commits for when the missing debug files Python API was added: * 8f6c452b5a4 gdb: implement missing debug handler hook for Python * 661d98a3331 gdb: add an extension language hook for missing debug info Thanks, Andrew --- Andrew Burgess (4): gdb: use mapped file information to improve debuginfod text gdb: rename ext_lang_missing_debuginfo_result gdb: add extension hook ext_lang_find_objfile_from_buildid gdb/python: implement Python find_exec_by_build_id hook gdb/NEWS | 24 + gdb/build-id.c | 88 ++- gdb/build-id.h | 3 +- gdb/corelow.c | 63 +- gdb/data-directory/Makefile.in | 4 +- gdb/debuginfod-support.c | 4 +- gdb/doc/gdb.texinfo | 1 + gdb/doc/python.texi | 194 ++++++- gdb/extension-priv.h | 15 +- gdb/extension.c | 26 +- gdb/extension.h | 30 +- gdb/python/lib/gdb/__init__.py | 110 +++- .../{missing_debug.py => missing_files.py} | 135 +++-- gdb/python/lib/gdb/missing_debug.py | 161 +----- gdb/python/lib/gdb/missing_files.py | 204 +++++++ gdb/python/lib/gdb/missing_objfile.py | 67 +++ gdb/python/py-progspace.c | 26 +- gdb/python/python.c | 120 +++- gdb/solib.c | 3 +- gdb/symfile-debug.c | 2 +- .../gdb.debuginfod/corefile-mapped-file.exp | 2 +- .../gdb.debuginfod/solib-with-soname.exp | 2 +- .../gdb.python/py-missing-objfile-lib.c | 35 ++ gdb/testsuite/gdb.python/py-missing-objfile.c | 49 ++ .../gdb.python/py-missing-objfile.exp | 544 ++++++++++++++++++ .../gdb.python/py-missing-objfile.py | 158 +++++ 26 files changed, 1787 insertions(+), 283 deletions(-) rename gdb/python/lib/gdb/command/{missing_debug.py => missing_files.py} (54%) create mode 100644 gdb/python/lib/gdb/missing_files.py create mode 100644 gdb/python/lib/gdb/missing_objfile.py create mode 100644 gdb/testsuite/gdb.python/py-missing-objfile-lib.c create mode 100644 gdb/testsuite/gdb.python/py-missing-objfile.c create mode 100644 gdb/testsuite/gdb.python/py-missing-objfile.exp create mode 100644 gdb/testsuite/gdb.python/py-missing-objfile.py base-commit: a723c56efb07c4f8b3f6a3ed4b878a2f8f5572cc -- 2.25.4