Message ID | 20230227011403.612304-1-simon.marchi@polymtl.ca |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 C6BB93858C62 for <patchwork@sourceware.org>; Mon, 27 Feb 2023 01:14:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6BB93858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677460474; bh=ZIVmVGpPQrJYrhtgzx85YxrbK6mpW1D7sIp/SkhAdts=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=fNcU/xQ2dHkdpm3+N7H6JnNyYsTSwWeMekdUlrlZwoU010TkfPSQl/FjZb5R0K5Cb vvfn2e3hmTbkO4huwvEoY6/+fof2XbTHWHybvQmaMyYpCgnIpbfM0ZTkRYLKgmvtot 1VPcTX7ppO12CjC75+fWHn50IZU1mTbK2rK5ZFOY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6A78F3858D1E for <gdb-patches@sourceware.org>; Mon, 27 Feb 2023 01:14:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A78F3858D1E Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 31R1E4hD026104 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Feb 2023 20:14:09 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 31R1E4hD026104 Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8841E1E0D3; Sun, 26 Feb 2023 20:14:04 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi <simon.marchi@polymtl.ca> Subject: [PATCH v3 00/10] Add typing annotations to gdbarch*.py and make-target-delegates.py Date: Sun, 26 Feb 2023 20:13:53 -0500 Message-Id: <20230227011403.612304-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 27 Feb 2023 01:14:04 +0000 X-Spam-Status: No, score=-3183.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Simon Marchi <simon.marchi@polymtl.ca> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Add typing annotations to gdbarch*.py and make-target-delegates.py
|
|
Message
Simon Marchi
Feb. 27, 2023, 1:13 a.m. UTC
This is v3 of: https://inbox.sourceware.org/gdb-patches/20230225033047.373899-2-simon.marchi@polymtl.ca/T/#mc1d1b386fd1235edb2a331dd0a321cf703a3e67b Changes are: - In "gdb: split gdbarch component types to gdbarch_types.py", I had introduced one typing annotation by mistake. It should have been in the following commit. That is fixed now. - For container types (lists and dicts), use the types from the typing module, to be compatible with Pythons < 3.9. Simon Marchi (10): gdb: remove invalid / dead code from gdbarch.py gdb: reformat Python files with black 23.1.0 gdb: gdbarch.py: spell out parameters of _Component.__init__ gdb: gdbarch.py: remove Info.__init__ gdb: pyproject.toml: set pyright typeCheckingMode = "strict" gdb: split gdbarch component types to gdbarch_types.py gdb: gdbarch*.py, copyright.py: add type annotations gdb: make-target-delegates.py: make one string raw gdb: make-target-delegates.py: add Entry type gdb: make-target-delegates.py: add type annotations gdb/gdbarch.py | 161 +-------------- ...ch-components.py => gdbarch_components.py} | 7 +- gdb/gdbarch_types.py | 184 ++++++++++++++++++ gdb/gdbcopyright.py | 2 +- gdb/make-target-delegates.py | 104 +++++++--- gdb/pyproject.toml | 3 + gdb/python/lib/gdb/FrameDecorator.py | 1 - gdb/python/lib/gdb/command/frame_filters.py | 1 + gdb/python/lib/gdb/dap/server.py | 2 +- gdb/python/lib/gdb/printing.py | 2 +- .../gdb.multi/multi-target-info-inferiors.py | 1 + gdb/testsuite/gdb.perf/backtrace.py | 1 - .../gdb.python/py-framefilter-addr.py | 1 + gdb/testsuite/gdb.python/py-framefilter.py | 1 + gdb/testsuite/gdb.python/py-inferior-leak.py | 2 + gdb/testsuite/gdb.python/py-prettyprint.py | 1 + gdb/testsuite/gdb.python/py-recurse-unwind.py | 5 - gdb/testsuite/gdb.python/py-send-packet.py | 1 + gdb/testsuite/gdb.python/tui-window.py | 1 + 19 files changed, 284 insertions(+), 197 deletions(-) rename gdb/{gdbarch-components.py => gdbarch_components.py} (99%) create mode 100755 gdb/gdbarch_types.py base-commit: 95ebc6fdec5780bf59685739cdd55cd41d0f55ac
Comments
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > This is v3 of: > > https://inbox.sourceware.org/gdb-patches/20230225033047.373899-2-simon.marchi@polymtl.ca/T/#mc1d1b386fd1235edb2a331dd0a321cf703a3e67b > > Changes are: > > - In "gdb: split gdbarch component types to gdbarch_types.py", I had > introduced one typing annotation by mistake. It should have been in > the following commit. That is fixed now. > - For container types (lists and dicts), use the types from the typing > module, to be compatible with Pythons < 3.9. Tested this with my crusty old Python (3.7.9) and can confirm that this all now runs fine, I see no changes in the generated files after running your updated gdbarch.py script. This all LGTM. Reviewed-By: Andrew Burgess <aburgess@redhat.com> Thanks, Andrew > > > Simon Marchi (10): > gdb: remove invalid / dead code from gdbarch.py > gdb: reformat Python files with black 23.1.0 > gdb: gdbarch.py: spell out parameters of _Component.__init__ > gdb: gdbarch.py: remove Info.__init__ > gdb: pyproject.toml: set pyright typeCheckingMode = "strict" > gdb: split gdbarch component types to gdbarch_types.py > gdb: gdbarch*.py, copyright.py: add type annotations > gdb: make-target-delegates.py: make one string raw > gdb: make-target-delegates.py: add Entry type > gdb: make-target-delegates.py: add type annotations > > gdb/gdbarch.py | 161 +-------------- > ...ch-components.py => gdbarch_components.py} | 7 +- > gdb/gdbarch_types.py | 184 ++++++++++++++++++ > gdb/gdbcopyright.py | 2 +- > gdb/make-target-delegates.py | 104 +++++++--- > gdb/pyproject.toml | 3 + > gdb/python/lib/gdb/FrameDecorator.py | 1 - > gdb/python/lib/gdb/command/frame_filters.py | 1 + > gdb/python/lib/gdb/dap/server.py | 2 +- > gdb/python/lib/gdb/printing.py | 2 +- > .../gdb.multi/multi-target-info-inferiors.py | 1 + > gdb/testsuite/gdb.perf/backtrace.py | 1 - > .../gdb.python/py-framefilter-addr.py | 1 + > gdb/testsuite/gdb.python/py-framefilter.py | 1 + > gdb/testsuite/gdb.python/py-inferior-leak.py | 2 + > gdb/testsuite/gdb.python/py-prettyprint.py | 1 + > gdb/testsuite/gdb.python/py-recurse-unwind.py | 5 - > gdb/testsuite/gdb.python/py-send-packet.py | 1 + > gdb/testsuite/gdb.python/tui-window.py | 1 + > 19 files changed, 284 insertions(+), 197 deletions(-) > rename gdb/{gdbarch-components.py => gdbarch_components.py} (99%) > create mode 100755 gdb/gdbarch_types.py > > > base-commit: 95ebc6fdec5780bf59685739cdd55cd41d0f55ac > -- > 2.39.2
On 2/27/23 12:38, Andrew Burgess wrote: > Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > >> This is v3 of: >> >> https://inbox.sourceware.org/gdb-patches/20230225033047.373899-2-simon.marchi@polymtl.ca/T/#mc1d1b386fd1235edb2a331dd0a321cf703a3e67b >> >> Changes are: >> >> - In "gdb: split gdbarch component types to gdbarch_types.py", I had >> introduced one typing annotation by mistake. It should have been in >> the following commit. That is fixed now. >> - For container types (lists and dicts), use the types from the typing >> module, to be compatible with Pythons < 3.9. > > Tested this with my crusty old Python (3.7.9) and can confirm that this > all now runs fine, I see no changes in the generated files after running > your updated gdbarch.py script. Thanks for testing. > This all LGTM. > > Reviewed-By: Andrew Burgess <aburgess@redhat.com> Thanks, will push. I will keep Tom Tromey's Reviewed-By, because the patches didn't fundamentally change since he looked at them. Simon