From patchwork Fri Mar 10 14:55:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 55566 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94AF5385B537 for ; Fri, 10 Mar 2023 14:56:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94AF5385B537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678460179; bh=dd3wdAPoiZQqPMefY59ypMe8PvHNYmmPq3DGIYh+0Fk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=NwjTNexLJIM1zb9OTK70pkN3epNQj4bzH3dlLDS4zWvVp1vTdFoUERlX0bBntupbm etsoI3LojdInsPfz3dV38zYgSquNDgc3XiHI24IDiwCY/O5ll3QX83wLMEm335sKZc njBIDe1VLoHTFQA6qGe+BW74xKwCW700fNnNaTd4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B77203858D32 for ; Fri, 10 Mar 2023 14:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B77203858D32 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-196-ayPBFTnRMW-nkma9R31QWg-1; Fri, 10 Mar 2023 09:55:52 -0500 X-MC-Unique: ayPBFTnRMW-nkma9R31QWg-1 Received: by mail-wm1-f71.google.com with SMTP id z6-20020a05600c220600b003e222c9c5f4so1918033wml.4 for ; Fri, 10 Mar 2023 06:55:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678460151; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dd3wdAPoiZQqPMefY59ypMe8PvHNYmmPq3DGIYh+0Fk=; b=RYAHNj/GQR+8rA0tbg/ej6rZPEKeSAFfo2KuuFi+8nw/+Xp1vwsM+3wh5OGBPmlzqB a01QsjXxauQsircO1x/z3k4LGhy4N0LOdRx8aCezqDSHw4jDPkDz4qZ2f7Spo5x+PQKS QymL93rLSJctV3tPqzzKG8Cy0JHd7Ui9aI4Z+WGlMabOTbmgVDjPQeKQGwy6+eYTRCa/ J1Qse7Wng/XzcY7pUqb93qfuIIp9SJU8mJrAmwoE8hptX9Z0IPWlFaq7RtwI5ky2qFyB ynvXLZ9Srn2wkSU5nFUc8QkUfFOdXdyU+dTrO3nUXTjZ3bbNF+HQPIhQk2T556G36iRN IwRA== X-Gm-Message-State: AO0yUKWAMi/poyXgvl2m8SSbIdcrcP0PmaofNmjv/AJl4B8LNiP+6w4e nYswqfmRDUQhE5PkNWnt8zXbSd0utlJxvqvcMbBFxSy4xOWiqqwUsIMe/4kKE+JueZFECorBQu1 XQKwLMj6rXJ+RbhBD1aro4jVGWzj4kVsURWXy9RdQI/uj+ubCRN360wthHZZOicSHRB2EHUcodx SIue4zHw== X-Received: by 2002:a5d:6385:0:b0:2c7:e424:eeb8 with SMTP id p5-20020a5d6385000000b002c7e424eeb8mr14767870wru.57.1678460151359; Fri, 10 Mar 2023 06:55:51 -0800 (PST) X-Google-Smtp-Source: AK7set9wAW8sgbiRj4gMerfFnPc3MOMHYQqnikiGLk02tUbo0FMtRYrWL0jHc7qpx/I1u6MwGkOGFw== X-Received: by 2002:a5d:6385:0:b0:2c7:e424:eeb8 with SMTP id p5-20020a5d6385000000b002c7e424eeb8mr14767858wru.57.1678460151042; Fri, 10 Mar 2023 06:55:51 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id e15-20020a5d4e8f000000b002425be3c9e2sm7334wru.60.2023.03.10.06.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:55:50 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 00/10] Improvements & Cleanup For Python Unwinder API Date: Fri, 10 Mar 2023 14:55:17 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-5.7 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" For I ended up writing a small project using GDB's Unwinder Python API. Though I could do everything I wanted, GDB's documentation in this area seemed a little lacking. So I started out just planning to cleanup the docs. But based on my experiences using the API, and after reading the docs through a couple of times, it felt like there were some small improvements that could be made to the API to make the lives of users easier. This series doesn't make any real changes to the API, but after this series the docs should be more complete, and the API a little more robust and easier to use. Oh, and tests. Lots more tests. Reviewed-By: Tom Tromey --- Andrew Burgess (10): gdb/doc: spring clean the Python unwinders documentation gdb/python: make the gdb.unwinder.Unwinder class more robust gdb/python: remove unneeded nullptr check in frapy_block gdb/python: add PENDING_FRAMEPY_REQUIRE_VALID macro in py-unwind.c gdb/python: add some additional methods to gdb.PendingFrame gdb/python: add __repr__ for PendingFrame and UnwindInfo gdb/python: remove Py_TPFLAGS_BASETYPE from gdb.UnwindInfo gdb: have value_as_address call unpack_pointer gdb/python: Allow gdb.UnwindInfo to be created with non gdb.Value args gdb/python: Add new gdb.unwinder.FrameId class gdb/NEWS | 43 +++ gdb/doc/python.texi | 212 +++++++++--- gdb/python/lib/gdb/unwinder.py | 49 ++- gdb/python/py-frame.c | 8 +- gdb/python/py-unwind.c | 456 ++++++++++++++++++++----- gdb/testsuite/gdb.python/py-unwind.exp | 216 +++++++++++- gdb/testsuite/gdb.python/py-unwind.py | 156 ++++++++- gdb/value.c | 9 +- 8 files changed, 996 insertions(+), 153 deletions(-) base-commit: 6a208145d24c47912c8beb4f1f4b9abeb8d51134