aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2026-01-22 13:41:02 -0700
committerTom Tromey <tromey@adacore.com>2026-01-23 06:45:46 -0700
commitcdc1fd1bcca89485842cb0989ac5bf8b41e6fd6c (patch)
tree84d3be12f8d347e9ebd7ea0aa853ede62d94741b /gdb/python/lib
parent4432c20455249f7e7b77738e67f347a6da5974c8 (diff)
downloadbinutils-cdc1fd1bcca89485842cb0989ac5bf8b41e6fd6c.tar.gz
binutils-cdc1fd1bcca89485842cb0989ac5bf8b41e6fd6c.tar.bz2
binutils-cdc1fd1bcca89485842cb0989ac5bf8b41e6fd6c.zip
Update black to 26.1.0
"pre-commit autoupdate" suggests a new version of black. This version seems to want to change how destructuring assignments are formatted. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/command/missing_files.py2
-rw-r--r--gdb/python/lib/gdb/command/pretty_printers.py14
-rw-r--r--gdb/python/lib/gdb/command/unwinders.py2
-rw-r--r--gdb/python/lib/gdb/dap/__init__.py2
-rw-r--r--gdb/python/lib/gdb/dap/breakpoint.py4
-rw-r--r--gdb/python/lib/gdb/dap/typecheck.py2
-rw-r--r--gdb/python/lib/gdb/dap/varref.py6
-rw-r--r--gdb/python/lib/gdb/printing.py2
8 files changed, 16 insertions, 18 deletions
diff --git a/gdb/python/lib/gdb/command/missing_files.py b/gdb/python/lib/gdb/command/missing_files.py
index 0b512da4f00..dc10d7610fc 100644
--- a/gdb/python/lib/gdb/command/missing_files.py
+++ b/gdb/python/lib/gdb/command/missing_files.py
@@ -176,7 +176,7 @@ def do_enable_handler1(handlers, name_re, flag, handler_type):
def do_enable_handler(arg, flag, handler_type):
"""Enable or disable missing file handlers."""
- (locus_re, name_re) = parse_missing_file_command_args(arg)
+ locus_re, name_re = parse_missing_file_command_args(arg)
total = 0
if locus_re.match("global"):
total += do_enable_handler1(
diff --git a/gdb/python/lib/gdb/command/pretty_printers.py b/gdb/python/lib/gdb/command/pretty_printers.py
index 2b7b1ec59ec..1775f9177d4 100644
--- a/gdb/python/lib/gdb/command/pretty_printers.py
+++ b/gdb/python/lib/gdb/command/pretty_printers.py
@@ -152,7 +152,7 @@ class InfoPrettyPrinter(gdb.Command):
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
- (object_re, name_re, subname_re) = parse_printer_regexps(arg)
+ object_re, name_re, subname_re = parse_printer_regexps(arg)
self.invoke1(
"global pretty-printers:",
gdb.pretty_printers,
@@ -211,16 +211,14 @@ def count_all_enabled_printers():
"""
enabled_count = 0
total_count = 0
- (t_enabled, t_total) = count_enabled_printers(gdb.pretty_printers)
+ t_enabled, t_total = count_enabled_printers(gdb.pretty_printers)
enabled_count += t_enabled
total_count += t_total
- (t_enabled, t_total) = count_enabled_printers(
- gdb.current_progspace().pretty_printers
- )
+ t_enabled, t_total = count_enabled_printers(gdb.current_progspace().pretty_printers)
enabled_count += t_enabled
total_count += t_total
for objfile in gdb.objfiles():
- (t_enabled, t_total) = count_enabled_printers(objfile.pretty_printers)
+ t_enabled, t_total = count_enabled_printers(objfile.pretty_printers)
enabled_count += t_enabled
total_count += t_total
return (enabled_count, total_count)
@@ -238,7 +236,7 @@ def show_pretty_printer_enabled_summary():
"""Print the number of printers enabled/disabled.
We count subprinters individually.
"""
- (enabled_count, total_count) = count_all_enabled_printers()
+ enabled_count, total_count = count_all_enabled_printers()
print("%d of %d printers enabled" % (enabled_count, total_count))
@@ -307,7 +305,7 @@ def do_enable_pretty_printer_1(pretty_printers, name_re, subname_re, flag):
def do_enable_pretty_printer(arg, flag):
"""Internal worker for enabling/disabling pretty-printers."""
- (object_re, name_re, subname_re) = parse_printer_regexps(arg)
+ object_re, name_re, subname_re = parse_printer_regexps(arg)
total = 0
if object_re.match("global"):
diff --git a/gdb/python/lib/gdb/command/unwinders.py b/gdb/python/lib/gdb/command/unwinders.py
index a3a530b6e3c..7c69c5a7967 100644
--- a/gdb/python/lib/gdb/command/unwinders.py
+++ b/gdb/python/lib/gdb/command/unwinders.py
@@ -129,7 +129,7 @@ def do_enable_unwinder1(unwinders, name_re, flag):
def do_enable_unwinder(arg, flag):
"""Enable/disable unwinder(s)."""
- (locus_re, name_re) = parse_unwinder_command_args(arg)
+ locus_re, name_re = parse_unwinder_command_args(arg)
total = 0
if locus_re.match("global"):
total += do_enable_unwinder1(gdb.frame_unwinders, name_re, flag)
diff --git a/gdb/python/lib/gdb/dap/__init__.py b/gdb/python/lib/gdb/dap/__init__.py
index 7b1937a5e15..8f68e0cf0b4 100644
--- a/gdb/python/lib/gdb/dap/__init__.py
+++ b/gdb/python/lib/gdb/dap/__init__.py
@@ -67,7 +67,7 @@ def run():
# Make the new stdout be a pipe. This way the DAP code can easily
# read from the inferior and send OutputEvent to the client.
- (rfd, wfd) = os.pipe()
+ rfd, wfd = os.pipe()
os.set_inheritable(rfd, False)
os.dup2(wfd, 1, True)
# Also send stderr this way.
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py
index 49b55bb35f9..2634fc8da7a 100644
--- a/gdb/python/lib/gdb/dap/breakpoint.py
+++ b/gdb/python/lib/gdb/dap/breakpoint.py
@@ -119,7 +119,7 @@ def _breakpoint_descriptor(bp):
# https://github.com/microsoft/debug-adapter-protocol/issues/13
loc = bp.locations[0]
if loc.source:
- (filename, line) = loc.source
+ filename, line = loc.source
if loc.fullname is not None:
filename = loc.fullname
@@ -161,7 +161,7 @@ def _set_breakpoints(kind, specs, creator):
# It makes sense to reuse a breakpoint even if the condition
# or ignore count differs, so remove these entries from the
# spec first.
- (condition, hit_condition) = _remove_entries(
+ condition, hit_condition = _remove_entries(
spec, "condition", "hitCondition"
)
keyspec = frozenset(spec.items())
diff --git a/gdb/python/lib/gdb/dap/typecheck.py b/gdb/python/lib/gdb/dap/typecheck.py
index d2c42e2c285..9f9f730e200 100644
--- a/gdb/python/lib/gdb/dap/typecheck.py
+++ b/gdb/python/lib/gdb/dap/typecheck.py
@@ -31,7 +31,7 @@ def _check_instance(value, typevar):
if not isinstance(value, collections.abc.Mapping):
return False
assert len(arg_types) == 2
- (keytype, valuetype) = arg_types
+ keytype, valuetype = arg_types
return all(
_check_instance(k, keytype) and _check_instance(v, valuetype)
for k, v in value.items()
diff --git a/gdb/python/lib/gdb/dap/varref.py b/gdb/python/lib/gdb/dap/varref.py
index 3810abf310a..3cd1ce74fbf 100644
--- a/gdb/python/lib/gdb/dap/varref.py
+++ b/gdb/python/lib/gdb/dap/varref.py
@@ -153,7 +153,7 @@ class BaseReference(ABC):
if idx >= len(self._children):
break
if self._children[idx] is None:
- (name, value) = self.fetch_one_child(idx)
+ name, value = self.fetch_one_child(idx)
name = self._compute_name(name)
var = VariableReference(name, value)
self._children[idx] = var
@@ -268,9 +268,9 @@ class VariableReference(BaseReference):
if isinstance(self._printer, gdb.ValuePrinter) and hasattr(
self._printer, "child"
):
- (name, val) = self._printer.child(idx)
+ name, val = self._printer.child(idx)
else:
- (name, val) = self.cache_children()[idx]
+ name, val = self.cache_children()[idx]
# A pretty-printer can return something other than a
# gdb.Value, but it must be convertible.
if not isinstance(val, gdb.Value):
diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py
index 9652617d2cf..701a5c4a049 100644
--- a/gdb/python/lib/gdb/printing.py
+++ b/gdb/python/lib/gdb/printing.py
@@ -343,7 +343,7 @@ class NoOpArrayPrinter(gdb.ValuePrinter):
def __init__(self, ty, value):
self.__value = value
- (low, high) = ty.range()
+ low, high = ty.range()
# In Ada, an array can have an index type that is a
# non-contiguous enum. In this case the indexing must be done
# by using the indices into the enum type, not the underlying