* [pushed 1/2] gdb: re-format with black 21.9b0
@ 2021-12-16 1:31 Simon Marchi
2021-12-16 1:31 ` [pushed 2/2] gdb: re-format with black 21.12b0 Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2021-12-16 1:31 UTC (permalink / raw)
To: gdb-patches
Run black 21.9b0 on gdb/ (this is the version currently mentioned on the
wiki [1], the subsequent commit will bump that version).
[1] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards
Change-Id: I5ceaab42c42428e053e2572df172aa42a88f0f86
---
gdb/gdb-gdb.py.in | 7 ++++---
.../gdb.multi/multi-target-info-inferiors.py | 14 +++++++++-----
gdb/testsuite/gdb.python/py-events.py | 9 ++++++---
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index a60ad013a73e..ae67f8103684 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -242,9 +242,10 @@ class StructMainTypePrettyPrinter:
" _mp_num and _mp_den fields if needed)"
)
elif type_specific_kind == "TYPE_SPECIFIC_INT":
- img = ("int_stuff = { bit_size = %d, bit_offset = %d }"
- % (type_specific["int_stuff"]["bit_size"],
- type_specific["int_stuff"]["bit_offset"]))
+ img = "int_stuff = { bit_size = %d, bit_offset = %d }" % (
+ type_specific["int_stuff"]["bit_size"],
+ type_specific["int_stuff"]["bit_offset"],
+ )
else:
img = (
"type_specific = ??? (unknown type_specific_kind: %s)"
diff --git a/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py b/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
index 78c82f200bdc..dfbca320f68b 100644
--- a/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
+++ b/gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
@@ -19,6 +19,7 @@ import gdb
def conn_num(c):
return c.num
+
# Takes a gdb.TargetConnection and return a string that is either the
# type, or the type and details (if the details are not None).
def make_target_connection_string(c):
@@ -27,6 +28,7 @@ def make_target_connection_string(c):
else:
return "%s %s" % (c.type, c.details)
+
# A Python implementation of 'info connections'. Produce output that
# is identical to the output of 'info connections' so we can check
# that aspects of gdb.TargetConnection work correctly.
@@ -48,17 +50,19 @@ def info_connections():
else:
prefix = " "
- print(fmt % (prefix, c.num, make_target_connection_string(c),
- c.description))
+ print(fmt % (prefix, c.num, make_target_connection_string(c), c.description))
+
def inf_num(i):
return i.num
+
# Print information about each inferior, and the connection it is
# using.
def info_inferiors():
all_inferiors = sorted(gdb.inferiors(), key=inf_num)
for i in gdb.inferiors():
- print("Inferior %d, Connection #%d: %s" %
- (i.num, i.connection_num,
- make_target_connection_string(i.connection)))
+ print(
+ "Inferior %d, Connection #%d: %s"
+ % (i.num, i.connection_num, make_target_connection_string(i.connection))
+ )
diff --git a/gdb/testsuite/gdb.python/py-events.py b/gdb/testsuite/gdb.python/py-events.py
index 57b0324598f6..b2051875b4c7 100644
--- a/gdb/testsuite/gdb.python/py-events.py
+++ b/gdb/testsuite/gdb.python/py-events.py
@@ -45,7 +45,7 @@ def breakpoint_stop_handler(event):
def exit_handler(event):
assert isinstance(event, gdb.ExitedEvent)
print("event type: exit")
- if hasattr(event, 'exit_code'):
+ if hasattr(event, "exit_code"):
print("exit code: %d" % (event.exit_code))
else:
print("exit code: not-present")
@@ -133,6 +133,7 @@ class test_newobj_events(gdb.Command):
test_newobj_events()
+
def gdb_exiting_handler(event, throw_error):
assert isinstance(event, gdb.GdbExitingEvent)
if throw_error:
@@ -141,6 +142,7 @@ def gdb_exiting_handler(event, throw_error):
print("event type: gdb-exiting")
print("exit code: %d" % (event.exit_code))
+
class test_exiting_event(gdb.Command):
"""GDB Exiting event."""
@@ -149,11 +151,12 @@ class test_exiting_event(gdb.Command):
def invoke(self, arg, from_tty):
if arg == "normal":
- gdb.events.gdb_exiting.connect(lambda e: gdb_exiting_handler(e,False))
+ gdb.events.gdb_exiting.connect(lambda e: gdb_exiting_handler(e, False))
elif arg == "error":
- gdb.events.gdb_exiting.connect(lambda e: gdb_exiting_handler(e,True))
+ gdb.events.gdb_exiting.connect(lambda e: gdb_exiting_handler(e, True))
else:
raise gdb.GdbError("invalid or missing argument")
print("GDB exiting event registered.")
+
test_exiting_event()
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pushed 2/2] gdb: re-format with black 21.12b0
2021-12-16 1:31 [pushed 1/2] gdb: re-format with black 21.9b0 Simon Marchi
@ 2021-12-16 1:31 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2021-12-16 1:31 UTC (permalink / raw)
To: gdb-patches
Run black 21.12b0 on gdb/, there is a single whitespace change. I will
update the wiki [1] in parallel to bump the version of black to 21.12b0.
[1] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards
Change-Id: Ib3b859e3506c74a4f15d16f1e44ef402de3b98e2
---
gdb/python/lib/gdb/__init__.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
index 7b6d87015488..170633763c61 100644
--- a/gdb/python/lib/gdb/__init__.py
+++ b/gdb/python/lib/gdb/__init__.py
@@ -243,7 +243,6 @@ try:
except:
return None
-
except:
def colorize(filename, contents):
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-16 1:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 1:31 [pushed 1/2] gdb: re-format with black 21.9b0 Simon Marchi
2021-12-16 1:31 ` [pushed 2/2] gdb: re-format with black 21.12b0 Simon Marchi
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).