|
1 | | -def __getattr__(name: str): ... # incomplete module |
| 1 | +from _typeshed import Incomplete, Unused |
| 2 | +from collections.abc import Sequence |
| 3 | +from contextlib import AbstractContextManager |
| 4 | +from typing import TypedDict, type_check_only |
| 5 | +from typing_extensions import NotRequired |
| 6 | + |
| 7 | +import gdb |
| 8 | + |
| 9 | +from .sources import Source |
| 10 | + |
| 11 | +@type_check_only |
| 12 | +class _SourceBreakpoint(TypedDict): |
| 13 | + source: str |
| 14 | + line: int |
| 15 | + condition: NotRequired[str | None] |
| 16 | + hitCondition: NotRequired[str | None] |
| 17 | + logMessage: NotRequired[str | None] |
| 18 | + |
| 19 | +@type_check_only |
| 20 | +class _ExceptionFilterOptions(TypedDict): |
| 21 | + filderId: str |
| 22 | + condition: NotRequired[str | None] |
| 23 | + |
| 24 | +@type_check_only |
| 25 | +class _BreakpointDescriptor(TypedDict): |
| 26 | + id: int |
| 27 | + verified: bool |
| 28 | + reason: NotRequired[str] # only present when verified is False. Possibly only literal "pending" or "failed" |
| 29 | + message: NotRequired[str] # only present when reason == "failed" |
| 30 | + source: NotRequired[Source] |
| 31 | + line: NotRequired[int] |
| 32 | + instructionReference: NotRequired[str] |
| 33 | + |
| 34 | +@type_check_only |
| 35 | +class _SetBreakpointResult(TypedDict): |
| 36 | + breakpoints: list[_BreakpointDescriptor] |
| 37 | + |
| 38 | +# frozenset entries are tuples from _SourceBreakpoint.items() or _ExceptionFilterOptions.items() |
| 39 | +breakpoint_map: dict[str, dict[frozenset[Incomplete], gdb.Breakpoint]] |
| 40 | + |
| 41 | +def suppress_new_breakpoint_event() -> AbstractContextManager[None]: ... |
| 42 | +def set_breakpoint(*, source: Source, breakpoints: Sequence[_SourceBreakpoint] = (), **args: Unused) -> _SetBreakpointResult: ... |
| 43 | +def set_fn_breakpoint(*, breakpoints: Sequence[_SourceBreakpoint], **args: Unused) -> _SetBreakpointResult: ... |
| 44 | +def set_insn_breakpoints( |
| 45 | + *, breakpoints: Sequence[_SourceBreakpoint], offset: int | None = None, **args: Unused |
| 46 | +) -> _SetBreakpointResult: ... |
| 47 | +def set_exception_breakpoints( |
| 48 | + *, filters: Sequence[str], filterOptions: Sequence[_ExceptionFilterOptions] = (), **args: Unused |
| 49 | +) -> _SetBreakpointResult: ... |
0 commit comments