aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-03-20 09:03:04 -0600
committerTom Tromey <tromey@adacore.com>2024-04-02 11:21:39 -0600
commitc2cf30e7608093773286081ebfc4067246ecba7e (patch)
tree7bedf2c98350c11ba4383b9bce32f6f1ccb71ae3 /gdb/python/lib
parent68982f618b28aebf47343922fb79e59ace0246eb (diff)
downloadgdb-c2cf30e7608093773286081ebfc4067246ecba7e.zip
gdb-c2cf30e7608093773286081ebfc4067246ecba7e.tar.gz
gdb-c2cf30e7608093773286081ebfc4067246ecba7e.tar.bz2
Run isort
This patch is the result of running 'isort .' in the gdb directory. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/__init__.py4
-rw-r--r--gdb/python/lib/gdb/command/frame_filters.py1
-rw-r--r--gdb/python/lib/gdb/command/missing_debug.py3
-rw-r--r--gdb/python/lib/gdb/command/pretty_printers.py3
-rw-r--r--gdb/python/lib/gdb/command/type_printers.py1
-rw-r--r--gdb/python/lib/gdb/command/unwinders.py3
-rw-r--r--gdb/python/lib/gdb/command/xmethods.py3
-rw-r--r--gdb/python/lib/gdb/dap/breakpoint.py9
-rw-r--r--gdb/python/lib/gdb/dap/bt.py5
-rw-r--r--gdb/python/lib/gdb/dap/disassemble.py2
-rw-r--r--gdb/python/lib/gdb/dap/evaluate.py10
-rw-r--r--gdb/python/lib/gdb/dap/events.py3
-rw-r--r--gdb/python/lib/gdb/dap/frames.py3
-rw-r--r--gdb/python/lib/gdb/dap/io.py2
-rw-r--r--gdb/python/lib/gdb/dap/launch.py8
-rw-r--r--gdb/python/lib/gdb/dap/locations.py4
-rw-r--r--gdb/python/lib/gdb/dap/memory.py3
-rw-r--r--gdb/python/lib/gdb/dap/scopes.py3
-rw-r--r--gdb/python/lib/gdb/dap/server.py12
-rw-r--r--gdb/python/lib/gdb/dap/sources.py5
-rw-r--r--gdb/python/lib/gdb/dap/startup.py6
-rw-r--r--gdb/python/lib/gdb/dap/state.py2
-rw-r--r--gdb/python/lib/gdb/dap/varref.py7
-rw-r--r--gdb/python/lib/gdb/disassembler.py3
-rw-r--r--gdb/python/lib/gdb/frames.py7
-rw-r--r--gdb/python/lib/gdb/function/caller_is.py3
-rw-r--r--gdb/python/lib/gdb/function/strfns.py3
-rw-r--r--gdb/python/lib/gdb/missing_debug.py5
-rw-r--r--gdb/python/lib/gdb/printing.py5
-rw-r--r--gdb/python/lib/gdb/prompt.py3
-rw-r--r--gdb/python/lib/gdb/styling.py4
-rw-r--r--gdb/python/lib/gdb/xmethod.py3
32 files changed, 75 insertions, 63 deletions
diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
index 9db91d8..6c3e241 100644
--- a/gdb/python/lib/gdb/__init__.py
+++ b/gdb/python/lib/gdb/__init__.py
@@ -13,11 +13,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import os
import signal
+import sys
import threading
import traceback
-import os
-import sys
from contextlib import contextmanager
# Python 3 moved "reload"
diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
index d774e19..4e1b320 100644
--- a/gdb/python/lib/gdb/command/frame_filters.py
+++ b/gdb/python/lib/gdb/command/frame_filters.py
@@ -17,6 +17,7 @@
"""GDB commands for working with frame-filters."""
import sys
+
import gdb
import gdb.frames
diff --git a/gdb/python/lib/gdb/command/missing_debug.py b/gdb/python/lib/gdb/command/missing_debug.py
index 9a55e18..313b88c 100644
--- a/gdb/python/lib/gdb/command/missing_debug.py
+++ b/gdb/python/lib/gdb/command/missing_debug.py
@@ -15,9 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import re
+import gdb
+
def validate_regexp(exp, idstring):
"""Compile exp into a compiler regular expression object.
diff --git a/gdb/python/lib/gdb/command/pretty_printers.py b/gdb/python/lib/gdb/command/pretty_printers.py
index 6a938ed..cb9b9f3 100644
--- a/gdb/python/lib/gdb/command/pretty_printers.py
+++ b/gdb/python/lib/gdb/command/pretty_printers.py
@@ -17,9 +17,10 @@
"""GDB commands for working with pretty-printers."""
import copy
-import gdb
import re
+import gdb
+
def parse_printer_regexps(arg):
"""Internal utility to parse a pretty-printer command argv.
diff --git a/gdb/python/lib/gdb/command/type_printers.py b/gdb/python/lib/gdb/command/type_printers.py
index 339f5aa..a2be226 100644
--- a/gdb/python/lib/gdb/command/type_printers.py
+++ b/gdb/python/lib/gdb/command/type_printers.py
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import copy
+
import gdb
"""GDB commands for working with type-printers."""
diff --git a/gdb/python/lib/gdb/command/unwinders.py b/gdb/python/lib/gdb/command/unwinders.py
index 886287f..b863b33 100644
--- a/gdb/python/lib/gdb/command/unwinders.py
+++ b/gdb/python/lib/gdb/command/unwinders.py
@@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import re
+import gdb
+
def validate_regexp(exp, idstring):
try:
diff --git a/gdb/python/lib/gdb/command/xmethods.py b/gdb/python/lib/gdb/command/xmethods.py
index fe310b7..f786227 100644
--- a/gdb/python/lib/gdb/command/xmethods.py
+++ b/gdb/python/lib/gdb/command/xmethods.py
@@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import re
+import gdb
+
"""GDB commands for working with xmethods."""
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py
index b4fb112..b2e7427 100644
--- a/gdb/python/lib/gdb/dap/breakpoint.py
+++ b/gdb/python/lib/gdb/dap/breakpoint.py
@@ -13,21 +13,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import os
import re
-
from contextlib import contextmanager
# These are deprecated in 3.9, but required in older versions.
from typing import Optional, Sequence
-from .server import request, capability, send_event
+import gdb
+
+from .server import capability, request, send_event
from .sources import make_source
-from .startup import in_gdb_thread, log_stack, parse_and_eval, LogLevel, DAPException
+from .startup import DAPException, LogLevel, in_gdb_thread, log_stack, parse_and_eval
from .typecheck import type_check
-
# True when suppressing new breakpoint events.
_suppress_bp = False
diff --git a/gdb/python/lib/gdb/dap/bt.py b/gdb/python/lib/gdb/dap/bt.py
index d65ce5f..e0c2e2a 100644
--- a/gdb/python/lib/gdb/dap/bt.py
+++ b/gdb/python/lib/gdb/dap/bt.py
@@ -13,16 +13,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import os
# This is deprecated in 3.9, but required in older versions.
from typing import Optional
+import gdb
+
from .frames import dap_frame_generator
from .modules import module_id
from .scopes import symbol_value
-from .server import request, capability
+from .server import capability, request
from .sources import make_source
from .startup import in_gdb_thread
from .state import set_thread
diff --git a/gdb/python/lib/gdb/dap/disassemble.py b/gdb/python/lib/gdb/dap/disassemble.py
index a782528..65bf3d4 100644
--- a/gdb/python/lib/gdb/dap/disassemble.py
+++ b/gdb/python/lib/gdb/dap/disassemble.py
@@ -15,7 +15,7 @@
import gdb
-from .server import request, capability
+from .server import capability, request
@request("disassemble")
diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py
index 62519a5..34843f4 100644
--- a/gdb/python/lib/gdb/dap/evaluate.py
+++ b/gdb/python/lib/gdb/dap/evaluate.py
@@ -13,15 +13,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
-
# This is deprecated in 3.9, but required in older versions.
from typing import Optional
+import gdb
+
from .frames import select_frame
-from .server import capability, request, client_bool_capability
-from .startup import in_gdb_thread, parse_and_eval, DAPException
-from .varref import find_variable, VariableReference, apply_format
+from .server import capability, client_bool_capability, request
+from .startup import DAPException, in_gdb_thread, parse_and_eval
+from .varref import VariableReference, apply_format, find_variable
class EvaluateResult(VariableReference):
diff --git a/gdb/python/lib/gdb/dap/events.py b/gdb/python/lib/gdb/dap/events.py
index 928f23f..276d314 100644
--- a/gdb/python/lib/gdb/dap/events.py
+++ b/gdb/python/lib/gdb/dap/events.py
@@ -15,11 +15,10 @@
import gdb
+from .modules import is_module, make_module
from .scopes import set_finish_value
from .server import send_event
from .startup import exec_and_log, in_gdb_thread, log
-from .modules import is_module, make_module
-
# True when the inferior is thought to be running, False otherwise.
# This may be accessed from any thread, which can be racy. However,
diff --git a/gdb/python/lib/gdb/dap/frames.py b/gdb/python/lib/gdb/dap/frames.py
index 161c84b..07a4e3e 100644
--- a/gdb/python/lib/gdb/dap/frames.py
+++ b/gdb/python/lib/gdb/dap/frames.py
@@ -13,14 +13,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import itertools
+import gdb
from gdb.frames import frame_iterator
from .startup import in_gdb_thread
-
# A list of all the frames we've reported. A frame's index in the
# list is its ID. We don't use a hash here because frames are not
# hashable.
diff --git a/gdb/python/lib/gdb/dap/io.py b/gdb/python/lib/gdb/dap/io.py
index bbf822d..03031a7 100644
--- a/gdb/python/lib/gdb/dap/io.py
+++ b/gdb/python/lib/gdb/dap/io.py
@@ -15,7 +15,7 @@
import json
-from .startup import start_thread, log, log_stack, LogLevel
+from .startup import LogLevel, log, log_stack, start_thread
def read_json(stream):
diff --git a/gdb/python/lib/gdb/dap/launch.py b/gdb/python/lib/gdb/dap/launch.py
index 6783d99..2674e02 100644
--- a/gdb/python/lib/gdb/dap/launch.py
+++ b/gdb/python/lib/gdb/dap/launch.py
@@ -13,14 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
-
# These are deprecated in 3.9, but required in older versions.
from typing import Mapping, Optional, Sequence
+import gdb
+
from .events import exec_and_expect_stop, expect_process, expect_stop
-from .server import request, capability
-from .startup import exec_and_log, DAPException
+from .server import capability, request
+from .startup import DAPException, exec_and_log
# Any parameters here are necessarily extensions -- DAP requires this
diff --git a/gdb/python/lib/gdb/dap/locations.py b/gdb/python/lib/gdb/dap/locations.py
index 098091b..92e68f5 100644
--- a/gdb/python/lib/gdb/dap/locations.py
+++ b/gdb/python/lib/gdb/dap/locations.py
@@ -13,11 +13,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
-
# This is deprecated in 3.9, but required in older versions.
from typing import Optional
+import gdb
+
from .server import capability, request
from .sources import decode_source
diff --git a/gdb/python/lib/gdb/dap/memory.py b/gdb/python/lib/gdb/dap/memory.py
index 19a61d6..dd62b0e 100644
--- a/gdb/python/lib/gdb/dap/memory.py
+++ b/gdb/python/lib/gdb/dap/memory.py
@@ -14,9 +14,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import base64
+
import gdb
-from .server import request, capability
+from .server import capability, request
@request("readMemory")
diff --git a/gdb/python/lib/gdb/dap/scopes.py b/gdb/python/lib/gdb/dap/scopes.py
index be2c382..8cd8601 100644
--- a/gdb/python/lib/gdb/dap/scopes.py
+++ b/gdb/python/lib/gdb/dap/scopes.py
@@ -16,11 +16,10 @@
import gdb
from .frames import frame_for_id
-from .startup import in_gdb_thread
from .server import request
+from .startup import in_gdb_thread
from .varref import BaseReference
-
# Map DAP frame IDs to scopes. This ensures that scopes are re-used.
frame_to_scope = {}
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index 70646f4..7eb8717 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -14,29 +14,29 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import functools
-import gdb
import heapq
import inspect
import json
import threading
from contextlib import contextmanager
-from .io import start_json_writer, read_json
+import gdb
+
+from .io import read_json, start_json_writer
from .startup import (
- exec_and_log,
DAPException,
DAPQueue,
+ LogLevel,
+ exec_and_log,
in_dap_thread,
in_gdb_thread,
- start_thread,
log,
log_stack,
- LogLevel,
+ start_thread,
thread_log,
)
from .typecheck import type_check
-
# Map capability names to values.
_capabilities = {}
diff --git a/gdb/python/lib/gdb/dap/sources.py b/gdb/python/lib/gdb/dap/sources.py
index c9b7720..ee3464d 100644
--- a/gdb/python/lib/gdb/dap/sources.py
+++ b/gdb/python/lib/gdb/dap/sources.py
@@ -17,9 +17,8 @@ import os
import gdb
-from .server import request, capability
-from .startup import in_gdb_thread, DAPException
-
+from .server import capability, request
+from .startup import DAPException, in_gdb_thread
# The next available source reference ID. Must be greater than 0.
_next_source = 1
diff --git a/gdb/python/lib/gdb/dap/startup.py b/gdb/python/lib/gdb/dap/startup.py
index aaf1e8c..58591c0 100644
--- a/gdb/python/lib/gdb/dap/startup.py
+++ b/gdb/python/lib/gdb/dap/startup.py
@@ -16,14 +16,14 @@
# Do not import other gdbdap modules here -- this module must come
# first.
import functools
-import gdb
import queue
+import sys
import threading
import traceback
-import sys
-
from enum import IntEnum, auto
+import gdb
+
# Adapt to different Queue types. This is exported for use in other
# modules as well.
if sys.version_info[0] == 3 and sys.version_info[1] <= 6:
diff --git a/gdb/python/lib/gdb/dap/state.py b/gdb/python/lib/gdb/dap/state.py
index 9cb7031..57ae355 100644
--- a/gdb/python/lib/gdb/dap/state.py
+++ b/gdb/python/lib/gdb/dap/state.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from .startup import in_gdb_thread, exec_and_log, log
+from .startup import exec_and_log, in_gdb_thread, log
@in_gdb_thread
diff --git a/gdb/python/lib/gdb/dap/varref.py b/gdb/python/lib/gdb/dap/varref.py
index e413e4e8..57e84a1 100644
--- a/gdb/python/lib/gdb/dap/varref.py
+++ b/gdb/python/lib/gdb/dap/varref.py
@@ -13,13 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
-from .startup import in_gdb_thread, DAPException
-from .server import client_bool_capability
from abc import ABC, abstractmethod
from collections import defaultdict
from contextlib import contextmanager
+import gdb
+
+from .server import client_bool_capability
+from .startup import DAPException, in_gdb_thread
# A list of all the variable references created during this pause.
all_variables = []
diff --git a/gdb/python/lib/gdb/disassembler.py b/gdb/python/lib/gdb/disassembler.py
index af7dcc5..72d311b 100644
--- a/gdb/python/lib/gdb/disassembler.py
+++ b/gdb/python/lib/gdb/disassembler.py
@@ -15,7 +15,6 @@
"""Disassembler related module."""
-import gdb
import _gdb.disassembler
# Re-export everything from the _gdb.disassembler module, which is
@@ -23,6 +22,8 @@ import _gdb.disassembler
# here to silence flake8.
from _gdb.disassembler import * # noqa: F401,F403
+import gdb
+
# Module global dictionary of gdb.disassembler.Disassembler objects.
# The keys of this dictionary are bfd architecture names, or the
# special value None.
diff --git a/gdb/python/lib/gdb/frames.py b/gdb/python/lib/gdb/frames.py
index 44f3217..a3be80c7 100644
--- a/gdb/python/lib/gdb/frames.py
+++ b/gdb/python/lib/gdb/frames.py
@@ -16,11 +16,12 @@
"""Internal functions for working with frame-filters."""
+import collections
+import itertools
+
import gdb
+from gdb.FrameDecorator import DAPFrameDecorator, FrameDecorator
from gdb.FrameIterator import FrameIterator
-from gdb.FrameDecorator import FrameDecorator, DAPFrameDecorator
-import itertools
-import collections
def get_priority(filter_item):
diff --git a/gdb/python/lib/gdb/function/caller_is.py b/gdb/python/lib/gdb/function/caller_is.py
index eb87c23..bacd8c0 100644
--- a/gdb/python/lib/gdb/function/caller_is.py
+++ b/gdb/python/lib/gdb/function/caller_is.py
@@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb
import re
+import gdb
+
class CallerIs(gdb.Function):
"""Check the calling function's name.
diff --git a/gdb/python/lib/gdb/function/strfns.py b/gdb/python/lib/gdb/function/strfns.py
index 42e5b9c..90c9cea 100644
--- a/gdb/python/lib/gdb/function/strfns.py
+++ b/gdb/python/lib/gdb/function/strfns.py
@@ -16,9 +16,10 @@
"""$_memeq, $_strlen, $_streq, $_regex"""
-import gdb
import re
+import gdb
+
class _MemEq(gdb.Function):
"""$_memeq - compare bytes of memory.
diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py
index 3093a9f..6d57462 100644
--- a/gdb/python/lib/gdb/missing_debug.py
+++ b/gdb/python/lib/gdb/missing_debug.py
@@ -17,9 +17,10 @@
MissingDebugHandler base class, and register_handler function.
"""
-import gdb
import sys
+import gdb
+
if sys.version_info >= (3, 7):
# Functions str.isascii() and str.isalnum are available starting Python
# 3.7.
@@ -32,7 +33,7 @@ if sys.version_info >= (3, 7):
else:
# Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for
# earlier versions.
- from curses.ascii import isascii, isalnum
+ from curses.ascii import isalnum, isascii
def _validate_name(name):
diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py
index d7933e9..55ba435 100644
--- a/gdb/python/lib/gdb/printing.py
+++ b/gdb/python/lib/gdb/printing.py
@@ -16,11 +16,12 @@
"""Utilities for working with pretty-printers."""
-import gdb
-import gdb.types
import itertools
import re
+import gdb
+import gdb.types
+
class PrettyPrinter(object):
"""A basic pretty-printer.
diff --git a/gdb/python/lib/gdb/prompt.py b/gdb/python/lib/gdb/prompt.py
index 02185b3..4ad38e4 100644
--- a/gdb/python/lib/gdb/prompt.py
+++ b/gdb/python/lib/gdb/prompt.py
@@ -16,9 +16,10 @@
""" Extended prompt library functions."""
-import gdb
import os
+import gdb
+
def _prompt_pwd(ignore):
"The current working directory."
diff --git a/gdb/python/lib/gdb/styling.py b/gdb/python/lib/gdb/styling.py
index 8e5d64f..1c5394e 100644
--- a/gdb/python/lib/gdb/styling.py
+++ b/gdb/python/lib/gdb/styling.py
@@ -19,9 +19,9 @@
import gdb
try:
- from pygments import formatters, lexers, highlight
- from pygments.token import Error, Comment, Text
+ from pygments import formatters, highlight, lexers
from pygments.filters import TokenMergeFilter
+ from pygments.token import Comment, Error, Text
_formatter = None
diff --git a/gdb/python/lib/gdb/xmethod.py b/gdb/python/lib/gdb/xmethod.py
index ea7b15c..c98402d 100644
--- a/gdb/python/lib/gdb/xmethod.py
+++ b/gdb/python/lib/gdb/xmethod.py
@@ -16,9 +16,10 @@
"""Utilities for defining xmethods"""
-import gdb
import re
+import gdb
+
class XMethod(object):
"""Base class (or a template) for an xmethod description.