From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 2/9] gdb: reformat Python files with black 23.1.0
Date: Thu, 23 Feb 2023 17:18:23 -0500 [thread overview]
Message-ID: <20230223221830.499934-3-simon.marchi@efficios.com> (raw)
In-Reply-To: <20230223221830.499934-1-simon.marchi@efficios.com>
From: Simon Marchi <simon.marchi@polymtl.ca>
Change-Id: Ie8ec8870a16d71c5858f5d08958309d23c318302
---
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/testsuite/gdb.multi/multi-target-info-inferiors.py | 1 +
gdb/testsuite/gdb.perf/backtrace.py | 1 -
gdb/testsuite/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 +
13 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/gdb/python/lib/gdb/FrameDecorator.py b/gdb/python/lib/gdb/FrameDecorator.py
index 82be4fc4ecb7..6773780735b4 100644
--- a/gdb/python/lib/gdb/FrameDecorator.py
+++ b/gdb/python/lib/gdb/FrameDecorator.py
@@ -64,7 +64,6 @@ class FrameDecorator(object):
or frame.type() == gdb.DUMMY_FRAME
or frame.type() == gdb.SIGTRAMP_FRAME
):
-
return True
return False
diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
index 0fca0e78dcbf..a88de49cfea1 100644
--- a/gdb/python/lib/gdb/command/frame_filters.py
+++ b/gdb/python/lib/gdb/command/frame_filters.py
@@ -20,6 +20,7 @@ import sys
import gdb
import gdb.frames
+
# GDB Commands.
class SetFilterPrefixCmd(gdb.Command):
"""Prefix command for 'set' frame-filter related operations."""
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index f8cb6170a969..7013cc3bff14 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -116,7 +116,7 @@ class Server:
self._send_json(result)
events = self.delayed_events
self.delayed_events = []
- for (event, body) in events:
+ for event, body in events:
self.send_event(event, body)
# Got the terminate request. This is handled by the
# JSON-writing thread, so that we can ensure that all
diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py
index 740a96e60eb4..1f724eebb2b8 100644
--- a/gdb/python/lib/gdb/printing.py
+++ b/gdb/python/lib/gdb/printing.py
@@ -228,7 +228,7 @@ class _EnumInstance:
flag_list = []
v = int(self.val)
any_found = False
- for (e_name, e_value) in self.enumerators:
+ for e_name, e_value in self.enumerators:
if v & e_value != 0:
flag_list.append(e_name)
v = v & ~e_value
diff --git a/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py b/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
index 585fee3f183b..c58045e1866b 100644
--- a/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
+++ b/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
@@ -15,6 +15,7 @@
import gdb
+
# Take a gdb.TargetConnection and return the connection number.
def conn_num(c):
return c.num
diff --git a/gdb/testsuite/gdb.perf/backtrace.py b/gdb/testsuite/gdb.perf/backtrace.py
index 01c4eed4ce84..df94a592f687 100644
--- a/gdb/testsuite/gdb.perf/backtrace.py
+++ b/gdb/testsuite/gdb.perf/backtrace.py
@@ -33,7 +33,6 @@ class BackTrace(perftest.TestCaseWithBasicMeasurements):
gdb.execute(do_test_command, False, True)
def execute_test(self):
-
line_size = 2
for _ in range(1, 12):
# Keep the total size of dcache unchanged, and increase the
diff --git a/gdb/testsuite/gdb.python/py-framefilter-addr.py b/gdb/testsuite/gdb.python/py-framefilter-addr.py
index a385abca69fd..f7702a2cf482 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-addr.py
+++ b/gdb/testsuite/gdb.python/py-framefilter-addr.py
@@ -18,6 +18,7 @@ import itertools
from gdb.FrameDecorator import FrameDecorator
import copy
+
# A FrameDecorator that just returns gdb.Frame.pc () from 'function'.
# We want to ensure that GDB correctly handles this case.
class Function_Returns_Address(FrameDecorator):
diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py
index b7c18d3e4c79..c82b88b56cff 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.py
+++ b/gdb/testsuite/gdb.python/py-framefilter.py
@@ -139,6 +139,7 @@ class FrameElider:
# thrown.
name_error = RuntimeError
+
# A simple decorator that gives an error when computing the function.
class ErrorInName(FrameDecorator):
def __init__(self, frame):
diff --git a/gdb/testsuite/gdb.python/py-inferior-leak.py b/gdb/testsuite/gdb.python/py-inferior-leak.py
index dbdf160dc6c2..c26a546943d3 100644
--- a/gdb/testsuite/gdb.python/py-inferior-leak.py
+++ b/gdb/testsuite/gdb.python/py-inferior-leak.py
@@ -21,6 +21,7 @@ import re
# object sent to us in the new_inferior event.
inf = None
+
# Register the new_inferior event handler.
def new_inferior_handler(event):
global inf
@@ -33,6 +34,7 @@ gdb.events.new_inferior.connect(new_inferior_handler)
# originating from this script.
filters = [tracemalloc.Filter(True, "*py-inferior-leak.py")]
+
# Add a new inferior, and return the number of the new inferior.
def add_inferior():
output = gdb.execute("add-inferior", False, True)
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py
index 20d31dc6dbf8..7dc02d84d9ad 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.py
+++ b/gdb/testsuite/gdb.python/py-prettyprint.py
@@ -89,6 +89,7 @@ class ArrayPrinter(object):
# Flag to make NoStringContainerPrinter throw an exception.
exception_flag = False
+
# Test a printer where to_string is None
class NoStringContainerPrinter(object):
def __init__(self, val):
diff --git a/gdb/testsuite/gdb.python/py-recurse-unwind.py b/gdb/testsuite/gdb.python/py-recurse-unwind.py
index 96d1badf6648..d73949310bcf 100644
--- a/gdb/testsuite/gdb.python/py-recurse-unwind.py
+++ b/gdb/testsuite/gdb.python/py-recurse-unwind.py
@@ -30,7 +30,6 @@ from gdb.unwinder import Unwinder
class TestUnwinder(Unwinder):
-
count = 0
@classmethod
@@ -52,7 +51,6 @@ class TestUnwinder(Unwinder):
self.recurse_level = 0
def __call__(self, pending_frame):
-
if self.recurse_level > 0:
gdb.write("TestUnwinder: Recursion detected - returning early.\n")
return None
@@ -61,19 +59,16 @@ class TestUnwinder(Unwinder):
TestUnwinder.inc_count()
if TestUnwinder.test == "check_user_reg_pc":
-
pc = pending_frame.read_register("pc")
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
elif TestUnwinder.test == "check_pae_pc":
-
pc = gdb.parse_and_eval("$pc")
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
elif TestUnwinder.test == "check_undefined_symbol":
-
try:
val = gdb.parse_and_eval("undefined_symbol")
diff --git a/gdb/testsuite/gdb.python/py-send-packet.py b/gdb/testsuite/gdb.python/py-send-packet.py
index 08e2f1e7bef0..fd42f8b786a9 100644
--- a/gdb/testsuite/gdb.python/py-send-packet.py
+++ b/gdb/testsuite/gdb.python/py-send-packet.py
@@ -16,6 +16,7 @@
import xml.etree.ElementTree as ET
import gdb
+
# Make use of gdb.RemoteTargetConnection.send_packet to fetch the
# thread list from the remote target.
#
diff --git a/gdb/testsuite/gdb.python/tui-window.py b/gdb/testsuite/gdb.python/tui-window.py
index 3d9ada56b5a2..401cb5197ff1 100644
--- a/gdb/testsuite/gdb.python/tui-window.py
+++ b/gdb/testsuite/gdb.python/tui-window.py
@@ -42,6 +42,7 @@ class TestWindow:
gdb.register_window_type("test", TestWindow)
+
# Call REMOVE_TITLE on the global window object.
def delete_window_title():
the_window.remove_title()
--
2.39.2
next prev parent reply other threads:[~2023-02-23 22:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 22:18 [PATCH 0/9] Add typing annotations to gdbarch*.py and make-target-delegates.py Simon Marchi
2023-02-23 22:18 ` [PATCH 1/9] gdb: remove invalid / dead code from gdbarch.py Simon Marchi
2023-02-23 22:18 ` Simon Marchi [this message]
2023-02-23 22:18 ` [PATCH 3/9] gdb: gdbarch.py: spell out parameters of _Component.__init__ Simon Marchi
2023-02-24 19:51 ` Tom Tromey
2023-02-24 20:31 ` Simon Marchi
2023-02-24 22:07 ` Tom Tromey
2023-02-23 22:18 ` [PATCH 4/9] gdb: pyproject.toml: set pyright typeCheckingMode = "strict" Simon Marchi
2023-02-23 22:18 ` [PATCH 5/9] gdb: split gdbarch component types to gdbarch_types.py Simon Marchi
2023-02-23 22:18 ` [PATCH 6/9] gdb: gdbarch*.py, copyright.py: add type annotations Simon Marchi
2023-02-23 22:18 ` [PATCH 7/9] gdb: make-target-delegates.py: make one string raw Simon Marchi
2023-02-23 22:18 ` [PATCH 8/9] gdb: make-target-delegates.py: add Entry type Simon Marchi
2023-02-23 22:18 ` [PATCH 9/9] gdb: make-target-delegates.py: add type annotations Simon Marchi
2023-02-24 19:54 ` [PATCH 0/9] Add typing annotations to gdbarch*.py and make-target-delegates.py Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230223221830.499934-3-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).