default_stages: [pre-commit]
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
- rev: 25.11.0
+ rev: 26.1.0
hooks:
- id: black
types_or: [file]
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(
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,
"""
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)
"""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))
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"):
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)
# 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.
# 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
# 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())
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()
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
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):
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