gdb: reformat Python files with black 23.1.0
Change-Id: Ie8ec8870a16d71c5858f5d08958309d23c318302 Reviewed-By: Tom Tromey <tom@tromey.com> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
parent
aa992b382f
commit
09de95fbb7
13 changed files with 11 additions and 9 deletions
|
@ -64,7 +64,6 @@ class FrameDecorator(object):
|
||||||
or frame.type() == gdb.DUMMY_FRAME
|
or frame.type() == gdb.DUMMY_FRAME
|
||||||
or frame.type() == gdb.SIGTRAMP_FRAME
|
or frame.type() == gdb.SIGTRAMP_FRAME
|
||||||
):
|
):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -20,6 +20,7 @@ import sys
|
||||||
import gdb
|
import gdb
|
||||||
import gdb.frames
|
import gdb.frames
|
||||||
|
|
||||||
|
|
||||||
# GDB Commands.
|
# GDB Commands.
|
||||||
class SetFilterPrefixCmd(gdb.Command):
|
class SetFilterPrefixCmd(gdb.Command):
|
||||||
"""Prefix command for 'set' frame-filter related operations."""
|
"""Prefix command for 'set' frame-filter related operations."""
|
||||||
|
|
|
@ -116,7 +116,7 @@ class Server:
|
||||||
self._send_json(result)
|
self._send_json(result)
|
||||||
events = self.delayed_events
|
events = self.delayed_events
|
||||||
self.delayed_events = []
|
self.delayed_events = []
|
||||||
for (event, body) in events:
|
for event, body in events:
|
||||||
self.send_event(event, body)
|
self.send_event(event, body)
|
||||||
# Got the terminate request. This is handled by the
|
# Got the terminate request. This is handled by the
|
||||||
# JSON-writing thread, so that we can ensure that all
|
# JSON-writing thread, so that we can ensure that all
|
||||||
|
|
|
@ -228,7 +228,7 @@ class _EnumInstance:
|
||||||
flag_list = []
|
flag_list = []
|
||||||
v = int(self.val)
|
v = int(self.val)
|
||||||
any_found = False
|
any_found = False
|
||||||
for (e_name, e_value) in self.enumerators:
|
for e_name, e_value in self.enumerators:
|
||||||
if v & e_value != 0:
|
if v & e_value != 0:
|
||||||
flag_list.append(e_name)
|
flag_list.append(e_name)
|
||||||
v = v & ~e_value
|
v = v & ~e_value
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
|
|
||||||
|
|
||||||
# Take a gdb.TargetConnection and return the connection number.
|
# Take a gdb.TargetConnection and return the connection number.
|
||||||
def conn_num(c):
|
def conn_num(c):
|
||||||
return c.num
|
return c.num
|
||||||
|
|
|
@ -33,7 +33,6 @@ class BackTrace(perftest.TestCaseWithBasicMeasurements):
|
||||||
gdb.execute(do_test_command, False, True)
|
gdb.execute(do_test_command, False, True)
|
||||||
|
|
||||||
def execute_test(self):
|
def execute_test(self):
|
||||||
|
|
||||||
line_size = 2
|
line_size = 2
|
||||||
for _ in range(1, 12):
|
for _ in range(1, 12):
|
||||||
# Keep the total size of dcache unchanged, and increase the
|
# Keep the total size of dcache unchanged, and increase the
|
||||||
|
|
|
@ -18,6 +18,7 @@ import itertools
|
||||||
from gdb.FrameDecorator import FrameDecorator
|
from gdb.FrameDecorator import FrameDecorator
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
|
||||||
# A FrameDecorator that just returns gdb.Frame.pc () from 'function'.
|
# A FrameDecorator that just returns gdb.Frame.pc () from 'function'.
|
||||||
# We want to ensure that GDB correctly handles this case.
|
# We want to ensure that GDB correctly handles this case.
|
||||||
class Function_Returns_Address(FrameDecorator):
|
class Function_Returns_Address(FrameDecorator):
|
||||||
|
|
|
@ -139,6 +139,7 @@ class FrameElider:
|
||||||
# thrown.
|
# thrown.
|
||||||
name_error = RuntimeError
|
name_error = RuntimeError
|
||||||
|
|
||||||
|
|
||||||
# A simple decorator that gives an error when computing the function.
|
# A simple decorator that gives an error when computing the function.
|
||||||
class ErrorInName(FrameDecorator):
|
class ErrorInName(FrameDecorator):
|
||||||
def __init__(self, frame):
|
def __init__(self, frame):
|
||||||
|
|
|
@ -21,6 +21,7 @@ import re
|
||||||
# object sent to us in the new_inferior event.
|
# object sent to us in the new_inferior event.
|
||||||
inf = None
|
inf = None
|
||||||
|
|
||||||
|
|
||||||
# Register the new_inferior event handler.
|
# Register the new_inferior event handler.
|
||||||
def new_inferior_handler(event):
|
def new_inferior_handler(event):
|
||||||
global inf
|
global inf
|
||||||
|
@ -33,6 +34,7 @@ gdb.events.new_inferior.connect(new_inferior_handler)
|
||||||
# originating from this script.
|
# originating from this script.
|
||||||
filters = [tracemalloc.Filter(True, "*py-inferior-leak.py")]
|
filters = [tracemalloc.Filter(True, "*py-inferior-leak.py")]
|
||||||
|
|
||||||
|
|
||||||
# Add a new inferior, and return the number of the new inferior.
|
# Add a new inferior, and return the number of the new inferior.
|
||||||
def add_inferior():
|
def add_inferior():
|
||||||
output = gdb.execute("add-inferior", False, True)
|
output = gdb.execute("add-inferior", False, True)
|
||||||
|
|
|
@ -89,6 +89,7 @@ class ArrayPrinter(object):
|
||||||
# Flag to make NoStringContainerPrinter throw an exception.
|
# Flag to make NoStringContainerPrinter throw an exception.
|
||||||
exception_flag = False
|
exception_flag = False
|
||||||
|
|
||||||
|
|
||||||
# Test a printer where to_string is None
|
# Test a printer where to_string is None
|
||||||
class NoStringContainerPrinter(object):
|
class NoStringContainerPrinter(object):
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
|
|
@ -30,7 +30,6 @@ from gdb.unwinder import Unwinder
|
||||||
|
|
||||||
|
|
||||||
class TestUnwinder(Unwinder):
|
class TestUnwinder(Unwinder):
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -52,7 +51,6 @@ class TestUnwinder(Unwinder):
|
||||||
self.recurse_level = 0
|
self.recurse_level = 0
|
||||||
|
|
||||||
def __call__(self, pending_frame):
|
def __call__(self, pending_frame):
|
||||||
|
|
||||||
if self.recurse_level > 0:
|
if self.recurse_level > 0:
|
||||||
gdb.write("TestUnwinder: Recursion detected - returning early.\n")
|
gdb.write("TestUnwinder: Recursion detected - returning early.\n")
|
||||||
return None
|
return None
|
||||||
|
@ -61,19 +59,16 @@ class TestUnwinder(Unwinder):
|
||||||
TestUnwinder.inc_count()
|
TestUnwinder.inc_count()
|
||||||
|
|
||||||
if TestUnwinder.test == "check_user_reg_pc":
|
if TestUnwinder.test == "check_user_reg_pc":
|
||||||
|
|
||||||
pc = pending_frame.read_register("pc")
|
pc = pending_frame.read_register("pc")
|
||||||
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
|
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
|
||||||
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
|
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
|
||||||
|
|
||||||
elif TestUnwinder.test == "check_pae_pc":
|
elif TestUnwinder.test == "check_pae_pc":
|
||||||
|
|
||||||
pc = gdb.parse_and_eval("$pc")
|
pc = gdb.parse_and_eval("$pc")
|
||||||
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
|
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
|
||||||
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
|
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
|
||||||
|
|
||||||
elif TestUnwinder.test == "check_undefined_symbol":
|
elif TestUnwinder.test == "check_undefined_symbol":
|
||||||
|
|
||||||
try:
|
try:
|
||||||
val = gdb.parse_and_eval("undefined_symbol")
|
val = gdb.parse_and_eval("undefined_symbol")
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
import gdb
|
import gdb
|
||||||
|
|
||||||
|
|
||||||
# Make use of gdb.RemoteTargetConnection.send_packet to fetch the
|
# Make use of gdb.RemoteTargetConnection.send_packet to fetch the
|
||||||
# thread list from the remote target.
|
# thread list from the remote target.
|
||||||
#
|
#
|
||||||
|
|
|
@ -42,6 +42,7 @@ class TestWindow:
|
||||||
|
|
||||||
gdb.register_window_type("test", TestWindow)
|
gdb.register_window_type("test", TestWindow)
|
||||||
|
|
||||||
|
|
||||||
# Call REMOVE_TITLE on the global window object.
|
# Call REMOVE_TITLE on the global window object.
|
||||||
def delete_window_title():
|
def delete_window_title():
|
||||||
the_window.remove_title()
|
the_window.remove_title()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue