| 1 |
import sys |
| 2 |
from _typeshed import ExcInfo, TraceFunction, Unused |
| 3 |
from collections.abc import Callable, Iterable, Iterator, Mapping |
| 4 |
from contextlib import contextmanager |
| 5 |
from types import CodeType, FrameType, TracebackType |
| 6 |
from typing import IO, Any, Final, Literal, SupportsInt, TypeVar |
| 7 |
from typing_extensions import ParamSpec, TypeAlias |
| 8 |
|
| 9 |
__all__ = ["BdbQuit", "Bdb", "Breakpoint"] |
| 10 |
|
| 11 |
_T = TypeVar("_T") |
| 12 |
_P = ParamSpec("_P") |
| 13 |
_Backend: TypeAlias = Literal["settrace", "monitoring"] |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
GENERATOR_AND_COROUTINE_FLAGS: Final[int] |
| 19 |
|
| 20 |
class BdbQuit(Exception): ... |
| 21 |
|
| 22 |
class Bdb: |
| 23 |
skip: set[str] | None |
| 24 |
breaks: dict[str, list[int]] |
| 25 |
fncache: dict[str, str] |
| 26 |
frame_returning: FrameType | None |
| 27 |
botframe: FrameType | None |
| 28 |
quitting: bool |
| 29 |
stopframe: FrameType | None |
| 30 |
returnframe: FrameType | None |
| 31 |
stoplineno: int |
| 32 |
if sys.version_info >= (3, 14): |
| 33 |
backend: _Backend |
| 34 |
def __init__(self, skip: Iterable[str] | None = None, backend: _Backend = "settrace") -> None: ... |
| 35 |
else: |
| 36 |
def __init__(self, skip: Iterable[str] | None = None) -> None: ... |
| 37 |
|
| 38 |
def canonic(self, filename: str) -> str: ... |
| 39 |
def reset(self) -> None: ... |
| 40 |
if sys.version_info >= (3, 12): |
| 41 |
@contextmanager |
| 42 |
def set_enterframe(self, frame: FrameType) -> Iterator[None]: ... |
| 43 |
|
| 44 |
def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ... |
| 45 |
def dispatch_line(self, frame: FrameType) -> TraceFunction: ... |
| 46 |
def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ... |
| 47 |
def dispatch_return(self, frame: FrameType, arg: Any) -> TraceFunction: ... |
| 48 |
def dispatch_exception(self, frame: FrameType, arg: ExcInfo) -> TraceFunction: ... |
| 49 |
if sys.version_info >= (3, 13): |
| 50 |
def dispatch_opcode(self, frame: FrameType, arg: Unused) -> Callable[[FrameType, str, Any], TraceFunction]: ... |
| 51 |
|
| 52 |
def is_skipped_module(self, module_name: str) -> bool: ... |
| 53 |
def stop_here(self, frame: FrameType) -> bool: ... |
| 54 |
def break_here(self, frame: FrameType) -> bool: ... |
| 55 |
def do_clear(self, arg: Any) -> bool | None: ... |
| 56 |
def break_anywhere(self, frame: FrameType) -> bool: ... |
| 57 |
def user_call(self, frame: FrameType, argument_list: None) -> None: ... |
| 58 |
def user_line(self, frame: FrameType) -> None: ... |
| 59 |
def user_return(self, frame: FrameType, return_value: Any) -> None: ... |
| 60 |
def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ... |
| 61 |
def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ... |
| 62 |
if sys.version_info >= (3, 13): |
| 63 |
def user_opcode(self, frame: FrameType) -> None: ... |
| 64 |
|
| 65 |
def set_step(self) -> None: ... |
| 66 |
if sys.version_info >= (3, 13): |
| 67 |
def set_stepinstr(self) -> None: ... |
| 68 |
|
| 69 |
def set_next(self, frame: FrameType) -> None: ... |
| 70 |
def set_return(self, frame: FrameType) -> None: ... |
| 71 |
def set_trace(self, frame: FrameType | None = None) -> None: ... |
| 72 |
def set_continue(self) -> None: ... |
| 73 |
def set_quit(self) -> None: ... |
| 74 |
def set_break( |
| 75 |
self, filename: str, lineno: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None |
| 76 |
) -> str | None: ... |
| 77 |
def clear_break(self, filename: str, lineno: int) -> str | None: ... |
| 78 |
def clear_bpbynumber(self, arg: SupportsInt) -> str | None: ... |
| 79 |
def clear_all_file_breaks(self, filename: str) -> str | None: ... |
| 80 |
def clear_all_breaks(self) -> str | None: ... |
| 81 |
def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ... |
| 82 |
def get_break(self, filename: str, lineno: int) -> bool: ... |
| 83 |
def get_breaks(self, filename: str, lineno: int) -> list[Breakpoint]: ... |
| 84 |
def get_file_breaks(self, filename: str) -> list[int]: ... |
| 85 |
def get_all_breaks(self) -> dict[str, list[int]]: ... |
| 86 |
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ... |
| 87 |
def format_stack_entry(self, frame_lineno: tuple[FrameType, int], lprefix: str = ": ") -> str: ... |
| 88 |
def run( |
| 89 |
self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None |
| 90 |
) -> None: ... |
| 91 |
def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... |
| 92 |
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ... |
| 93 |
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... |
| 94 |
if sys.version_info >= (3, 14): |
| 95 |
def start_trace(self) -> None: ... |
| 96 |
def stop_trace(self) -> None: ... |
| 97 |
def disable_current_event(self) -> None: ... |
| 98 |
def restart_events(self) -> None: ... |
| 99 |
|
| 100 |
class Breakpoint: |
| 101 |
next: int |
| 102 |
bplist: dict[tuple[str, int], list[Breakpoint]] |
| 103 |
bpbynumber: list[Breakpoint | None] |
| 104 |
|
| 105 |
funcname: str | None |
| 106 |
func_first_executable_line: int | None |
| 107 |
file: str |
| 108 |
line: int |
| 109 |
temporary: bool |
| 110 |
cond: str | None |
| 111 |
enabled: bool |
| 112 |
ignore: int |
| 113 |
hits: int |
| 114 |
number: int |
| 115 |
def __init__( |
| 116 |
self, file: str, line: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None |
| 117 |
) -> None: ... |
| 118 |
if sys.version_info >= (3, 11): |
| 119 |
@staticmethod |
| 120 |
def clearBreakpoints() -> None: ... |
| 121 |
|
| 122 |
def deleteMe(self) -> None: ... |
| 123 |
def enable(self) -> None: ... |
| 124 |
def disable(self) -> None: ... |
| 125 |
def bpprint(self, out: IO[str] | None = None) -> None: ... |
| 126 |
def bpformat(self) -> str: ... |
| 127 |
|
| 128 |
def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... |
| 129 |
def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ... |
| 130 |
def set_trace() -> None: ... |