From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OTLHHgql0miySQ8AWB0awg (envelope-from ) for ; Tue, 23 Sep 2025 09:47:54 -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=J459hj7Q; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 785A61E0BA; Tue, 23 Sep 2025 09:47:54 -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 B79631E047 for ; Tue, 23 Sep 2025 09:47:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C98DB385840B for ; Tue, 23 Sep 2025 13:47:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C98DB385840B 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=J459hj7Q 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 EE7643858D26 for ; Tue, 23 Sep 2025 13:44:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE7643858D26 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 EE7643858D26 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=1758635058; cv=none; b=BVk35RPDbJ/zaPv5LPCADVQ0R8Ccp2p7+3BTrTiLRnscawsr+8+y91L35jqMJj/09slzpIMyNWgLWNRxIcF+fNXNGbM2yM/4U8OWdn1DHXYVwMAZgAtgre9FuDaPYwAnZGQ/nN9lbT+YrJFBrNdb/+C0zsbLaigipgJGNHoXQ40= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758635058; c=relaxed/simple; bh=uNTKRbwSX1LcyTH5bZcIEmaPFYqNTqurgDCHTshbWes=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R/LzAxB9ZlxB0g5arDsbVrRGxz1wj44FynjXqzDgj/QtlXBW70gnrG4uG25zHGPO9fVGRlj1NEr6I8+Vbl9eO9p2tjvB1oh9jPNxqqco4q+OsbNNfRuj5jLb0LtwxBoZylpPGyFdYnuF18W5bSD4Y2sLjn7WwUdtfPl+V8lE1k8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE7643858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758635057; 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=n4Aq1o4FkRadvXg59S3kAma6HrrlMF41+1v6GiG/e5U=; b=J459hj7QbLQ8mgMsS1FYAXTevNxBln7CmHVl2YCP8SMnbIs8u7zezPUbECMhjBsIhyYR0j 6rkre4TH1GMKlTbg4qYMw8zfD7g/ggaNLBpjjwO1GSGxAm8QpuzpF3VSeS3bTYBho3ssB+ qxS1s8jk3K52NHzotPDiPsB05AyZY0c= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-9Vodz_FSNSiXulUqfo1LOA-1; Tue, 23 Sep 2025 09:44:15 -0400 X-MC-Unique: 9Vodz_FSNSiXulUqfo1LOA-1 X-Mimecast-MFC-AGG-ID: 9Vodz_FSNSiXulUqfo1LOA_1758635055 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-45de5fdda1aso32214855e9.1 for ; Tue, 23 Sep 2025 06:44:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758635054; x=1759239854; 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=n4Aq1o4FkRadvXg59S3kAma6HrrlMF41+1v6GiG/e5U=; b=tQ71+bwg0qyFaAddl7IWqgZe12GR2fZ5w1j7v84mojRNT2pBTwYtdSZ6CNjOv2r0CU ifrOjP4BOTEJX47zHxZmF3ld47QLb/BhIL5Cpv1ysaEx25f4x8Y/8qMteU7NrFXQXTwx By99BZ6NqrGW8HOWiJzip7Ni64POkRm0N/S9MkmtR+khqEQVgNqS8dKI6DUP1RKw5cpJ ep/qWopPSgLD0o8TO79LDpyNpX+cdtcgmg6Zn6lZ/IuXtZqQ4d0x7fPezBK8U+BYJSL6 mQ35/RfCf4Udb+M2aSv2N9xFa2BD+ogFkM5oILd1VmELfm162mU7BAHSrcq7SsmEoFHv UAUQ== X-Gm-Message-State: AOJu0YwjCQSGJKtRwlScfL+oeW2DKWjN+jZeKlH55sgeFW87QFYGwQQg XUZvR2EkQoZxaMdRBJfCgPyoC3ednVGMt2UOvECHzKaTbiL5dlNtxt4isAHwYo+ja1MqDef8pu+ HG3vlvEryoQb5Baa9erxizYXIZUbunKwtCdDzXV/i0C3eTGvtzmPzmzYo1pLzHSciLHnFunXHPm q6YA8XRbg3qzDbQMTwITSxHC4Cx2GM1ndh542DiwZUfJ2cUbE= X-Gm-Gg: ASbGncvny3urTpmfzU7CcROEjNYVptfdmoHJlzaL9cxiSUzmbBc11EacTBH9slxEory 7ATVIT1HHpRmpGnKQtdKAthssjz0mOvcj43HTfbXgIFlJRy/0TZpPPqv317MGET80OzgWnWdzV0 3mGFwj9lxXReH8XDoea4VmZz60kbjh6UvUOLDaGPJcnBPMcN5KfyTMcCnLKFEgyr/r0xH6nB7Gr qH77KImmDQTOxbXxODxQiwOfc3Zmt2qzi2sIse3WN5qOdB2SbewSWPCYpP1b4+tl0onMkqvGy5Y rFK35SlqjmIwLPHq59bet/LB/PIs7iMF+9w= X-Received: by 2002:a05:600c:45d4:b0:46d:b665:1d95 with SMTP id 5b1f17b1804b1-46e1dac98c7mr24721755e9.32.1758635054252; Tue, 23 Sep 2025 06:44:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG32CW1EJt6zOExhSDfLAHmkUpITKffEKdhd7xuxV2yfnIQkY0qFMzocjagLqoIMkXHHbqkPQ== X-Received: by 2002:a05:600c:45d4:b0:46d:b665:1d95 with SMTP id 5b1f17b1804b1-46e1dac98c7mr24721435e9.32.1758635053755; Tue, 23 Sep 2025 06:44:13 -0700 (PDT) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46dd4e52b36sm67791595e9.14.2025.09.23.06.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Sep 2025 06:44:13 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 0/3] Core file Python API Date: Tue, 23 Sep 2025 14:44:05 +0100 Message-ID: X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: gIZgZzz7xmTHwAEzW7udtlmEWhX8oxd7ZWVf7QpxbUM_1758635055 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 In v2: + Patches 1 and 3 updated inline with Tom's feedback. + Rebased to current HEAD. + Retested. This series extends the Python API to allow users to query the currently loaded core file, and to find out things about the core file. There's probably more features we could offer, but I think this is a reasonable starting point. All feedback welcome. Thanks, Andrew --- Andrew Burgess (3): gdb/python: introduce gdb.Corefile API gdb: make structured core file mappings processing global gdb/python: add Corefile.mapped_files method gdb/Makefile.in | 1 + gdb/NEWS | 33 ++ gdb/corelow.c | 225 ++++---- gdb/doc/python.texi | 110 ++++ gdb/gdbcore.h | 43 ++ gdb/observable.c | 1 + gdb/observable.h | 6 + gdb/python/py-corefile.c | 688 +++++++++++++++++++++++ gdb/python/py-inferior.c | 18 + gdb/python/python-internal.h | 8 + gdb/testsuite/gdb.python/py-corefile.c | 25 + gdb/testsuite/gdb.python/py-corefile.exp | 236 ++++++++ gdb/testsuite/gdb.python/py-corefile.py | 144 +++++ 13 files changed, 1437 insertions(+), 101 deletions(-) create mode 100644 gdb/python/py-corefile.c create mode 100644 gdb/testsuite/gdb.python/py-corefile.c create mode 100644 gdb/testsuite/gdb.python/py-corefile.exp create mode 100644 gdb/testsuite/gdb.python/py-corefile.py base-commit: 84dd63f3279dc0d1e13351dbc7b11261800e4758 -- 2.47.1