Add @disjoint_base decorator to the third-party stubs (#14716)

This commit is contained in:
Brian Schubert
2025-09-15 02:16:16 +02:00
committed by GitHub
parent 0d100b9110
commit 47dbbd6c91
27 changed files with 110 additions and 24 deletions
+9 -1
View File
@@ -7,7 +7,7 @@ import threading
from collections.abc import Callable, Iterator, Mapping, Sequence
from contextlib import AbstractContextManager
from typing import Any, Final, Generic, Literal, Protocol, TypedDict, TypeVar, final, overload, type_check_only
from typing_extensions import TypeAlias, deprecated
from typing_extensions import TypeAlias, deprecated, disjoint_base
import gdb.FrameDecorator
import gdb.types
@@ -74,6 +74,7 @@ class GdbError(Exception): ...
_ValueOrNative: TypeAlias = bool | int | float | str | Value | LazyString
_ValueOrInt: TypeAlias = Value | int
@disjoint_base
class Value:
address: Value
is_optimized_out: bool
@@ -406,6 +407,7 @@ class RecordFunctionSegment:
# CLI Commands
@disjoint_base
class Command:
def __init__(self, name: str, command_class: int, completer_class: int = ..., prefix: bool = ...) -> None: ...
def dont_repeat(self) -> None: ...
@@ -437,6 +439,7 @@ COMPLETE_EXPRESSION: int
# GDB/MI Commands
@disjoint_base
class MICommand:
name: str
installed: bool
@@ -446,6 +449,7 @@ class MICommand:
# Parameters
@disjoint_base
class Parameter:
set_doc: str
show_doc: str
@@ -682,6 +686,7 @@ class LineTable:
# Breakpoints
@disjoint_base
class Breakpoint:
# The where="spec" form of __init__(). See py-breakpoints.c:bppy_init():keywords for the positional order.
@overload
@@ -854,6 +859,7 @@ WP_ACCESS: int
# Finish Breakpoints
@disjoint_base
class FinishBreakpoint(Breakpoint):
return_value: Value | None
@@ -907,6 +913,7 @@ class RegisterGroupsIterator(Iterator[RegisterGroup]):
# Connections
@disjoint_base
class TargetConnection:
def is_valid(self) -> bool: ...
@@ -941,6 +948,7 @@ class _Window(Protocol):
def click(self, x: int, y: int, button: int) -> None: ...
# Events
@disjoint_base
class Event: ...
class ThreadEvent(Event):
+2
View File
@@ -1,5 +1,6 @@
from collections.abc import Sequence
from typing import Final, final
from typing_extensions import disjoint_base
import gdb
from gdb import Architecture, Progspace
@@ -8,6 +9,7 @@ class Disassembler:
def __init__(self, name: str) -> None: ...
def __call__(self, info): ...
@disjoint_base
class DisassembleInfo:
address: int
architecture: Architecture