Skip to content

Bump gdb to 15.0.* #12804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"stubs/docutils",
"stubs/Flask-SocketIO",
"stubs/fpdf2",
"stubs/gdb",
"stubs/google-cloud-ndb",
"stubs/hdbcli/hdbcli/dbapi.pyi",
"stubs/html5lib",
Expand Down
16 changes: 6 additions & 10 deletions stubs/gdb/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gdb.FinishBreakpoint.out_of_scope
gdb.Parameter.get_set_string
gdb.Parameter.get_show_string


# TODO: abstract/optional methods to be implemented by subclasses
# gdb.FinishBreakpoint.out_of_scope
gdb.Breakpoint.stop
Expand All @@ -30,15 +29,13 @@ gdb.TuiWindow
gdb.command
gdb.command.explore
gdb.command.frame_filters
gdb.command.missing_debug
gdb.command.pretty_printers
gdb.command.prompt
gdb.command.type_printers
gdb.command.unwinders
gdb.command.xmethods

# module is auto-imported with gdb and cannot be imported on its own
gdb.events

# implementing internal convenience functions
gdb.function
gdb.function.as_string
Expand Down Expand Up @@ -74,9 +71,8 @@ gdb.xmethods
gdb.Objfile.xmethods
gdb.Progspace.xmethods

# Python 2 compatibility defines
gdb.FrameDecorator.basestring
gdb.printing.basestring
gdb.printing.long
gdb.xmethod.basestring
gdb.xmethod.long
# stubtest thinks this can't be sub-classed at runtime, but it is
gdb.disassembler.DisassemblerPart

# incomplete modules
gdb\.dap\.[a-z_]+\.[A-Za-z_]+
2 changes: 1 addition & 1 deletion stubs/gdb/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "12.1.*"
version = "15.0.*"
# This is the official web portal for GDB,
# see https://sourceware.org/gdb/current/ for other ways of obtaining the source code.
upstream_repository = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=tree"
Expand Down
9 changes: 7 additions & 2 deletions stubs/gdb/gdb/FrameDecorator.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ class SymValueWrapper(Protocol):
def symbol(self) -> gdb.Symbol | str: ...
def value(self) -> gdb._ValueOrNative | None: ...

class FrameDecorator:
class _FrameDecoratorBase:
def __init__(self, base: gdb.Frame | FrameDecorator) -> None: ...
def elided(self) -> Iterator[gdb.Frame] | None: ...
def function(self) -> str | None: ...
def address(self) -> int | None: ...
def filename(self) -> str | None: ...
def line(self) -> int | None: ...
def frame_args(self) -> Iterator[SymValueWrapper] | None: ...
def frame_locals(self) -> Iterator[SymValueWrapper] | None: ...
def inferior_frame(self) -> gdb.Frame: ...

class FrameDecorator(_FrameDecoratorBase):
def filename(self) -> str | None: ...

class DAPFrameDecorator(_FrameDecoratorBase):
def filename(self) -> str | None: ...
1 change: 0 additions & 1 deletion stubs/gdb/gdb/FrameIterator.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ class FrameIterator:

def __init__(self, frame_obj: gdb.Frame) -> None: ...
def __iter__(self) -> FrameIterator: ...
def next(self) -> gdb.Frame: ...
def __next__(self) -> gdb.Frame: ...
177 changes: 120 additions & 57 deletions stubs/gdb/gdb/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# (https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html).

import _typeshed
import threading
from _typeshed import Incomplete
from collections.abc import Callable, Iterator, Mapping, Sequence
from contextlib import AbstractContextManager
from typing import Any, Generic, Literal, Protocol, TypeVar, final, overload
from typing import Any, Final, Generic, Literal, Protocol, TypeVar, final, overload
from typing_extensions import TypeAlias, deprecated

import gdb.FrameDecorator
Expand Down Expand Up @@ -136,6 +138,8 @@ class Value:
def string(self, encoding: str = ..., errors: str = ..., length: int = ...) -> str: ...
def lazy_string(self, encoding: str = ..., length: int = ...) -> LazyString: ...
def fetch_lazy(self) -> None: ...
def assign(self, val): ...
def to_array(self): ...

# Types

Expand Down Expand Up @@ -193,33 +197,46 @@ class Field:
type: Type | None
parent_type: Type

TYPE_CODE_PTR: int
TYPE_CODE_ARRAY: int
TYPE_CODE_STRUCT: int
TYPE_CODE_UNION: int
TYPE_CODE_ENUM: int
TYPE_CODE_FLAGS: int
TYPE_CODE_FUNC: int
TYPE_CODE_INT: int
TYPE_CODE_FLT: int
TYPE_CODE_VOID: int
TYPE_CODE_SET: int
TYPE_CODE_RANGE: int
TYPE_CODE_STRING: int
TYPE_CODE_BITSTRING: int
TYPE_CODE_ERROR: int
TYPE_CODE_METHOD: int
TYPE_CODE_METHODPTR: int
TYPE_CODE_MEMBERPTR: int
TYPE_CODE_REF: int
TYPE_CODE_RVALUE_REF: int
TYPE_CODE_CHAR: int
TYPE_CODE_BOOL: int
TYPE_CODE_COMPLEX: int
TYPE_CODE_TYPEDEF: int
TYPE_CODE_NAMESPACE: int
TYPE_CODE_DECFLOAT: int
TYPE_CODE_INTERNAL_FUNCTION: int
TYPE_CODE_BITSTRING: Final = -1
TYPE_CODE_PTR: Final = 1
TYPE_CODE_ARRAY: Final = 2
TYPE_CODE_STRUCT: Final = 3
TYPE_CODE_UNION: Final = 4
TYPE_CODE_ENUM: Final = 5
TYPE_CODE_FLAGS: Final = 6
TYPE_CODE_FUNC: Final = 7
TYPE_CODE_INT: Final = 8
TYPE_CODE_FLT: Final = 9
TYPE_CODE_VOID: Final = 10
TYPE_CODE_SET: Final = 11
TYPE_CODE_RANGE: Final = 12
TYPE_CODE_STRING: Final = 13
TYPE_CODE_ERROR: Final = 14
TYPE_CODE_METHOD: Final = 15
TYPE_CODE_METHODPTR: Final = 16
TYPE_CODE_MEMBERPTR: Final = 17
TYPE_CODE_REF: Final = 18
TYPE_CODE_RVALUE_REF: Final = 19
TYPE_CODE_CHAR: Final = 20
TYPE_CODE_BOOL: Final = 21
TYPE_CODE_COMPLEX: Final = 22
TYPE_CODE_TYPEDEF: Final = 23
TYPE_CODE_NAMESPACE: Final = 24
TYPE_CODE_DECFLOAT: Final = 25
TYPE_CODE_MODULE: Final = 26
TYPE_CODE_INTERNAL_FUNCTION: Final = 27
TYPE_CODE_XMETHOD: Final = 28
TYPE_CODE_FIXED_POINT: Final = 29
TYPE_CODE_NAMELIST: Final = 30

SEARCH_UNDEF_DOMAIN: Final[int]
SEARCH_VAR_DOMAIN: Final[int]
SEARCH_STRUCT_DOMAIN: Final[int]
SEARCH_MODULE_DOMAIN: Final[int]
SEARCH_LABEL_DOMAIN: Final[int]
SEARCH_COMMON_BLOCK_DOMAIN: Final[int]
SEARCH_TYPE_DOMAIN: Final[int]
SEARCH_FUNCTION_DOMAIN: Final[int]

# Pretty Printing

Expand Down Expand Up @@ -259,8 +276,16 @@ class PendingFrame:
def read_register(self, reg: str | RegisterDescriptor | int, /) -> Value: ...
def create_unwind_info(self, frame_id: object, /) -> UnwindInfo: ...
def architecture(self) -> Architecture: ...
def language(self): ...
def level(self) -> int: ...
def name(self) -> str: ...
def pc(self) -> int: ...
def block(self) -> Block: ...
def find_sal(self) -> Symtab_and_line: ...
def function(self) -> Symbol: ...
def is_valid(self) -> bool: ...

@final
class UnwindInfo:
def add_saved_register(self, reg: str | RegisterDescriptor | int, value: Value, /) -> None: ...

Expand All @@ -281,6 +306,8 @@ class Inferior:
pid: int
was_attached: bool
progspace: Progspace
main_name: Incomplete
arguments: Incomplete

def is_valid(self) -> bool: ...
def threads(self) -> tuple[InferiorThread, ...]: ...
Expand All @@ -291,9 +318,14 @@ class Inferior:
def thread_from_handle(self, handle: Value) -> InferiorThread: ...
@deprecated("Use gdb.thread_from_handle() instead.")
def thread_from_thread_handle(self, handle: Value) -> InferiorThread: ...
def set_env(self, name: str, value: str) -> None: ...
def unset_env(self, name: str) -> None: ...
def clear_env(self) -> None: ...

# Threads

class Thread(threading.Thread): ...

def selected_thread() -> InferiorThread: ...
@final
class InferiorThread:
Expand All @@ -302,6 +334,7 @@ class InferiorThread:
num: int
global_num: int
ptid: tuple[int, int, int]
ptid_string: str
inferior: Inferior

def is_valid(self) -> bool: ...
Expand Down Expand Up @@ -429,15 +462,19 @@ def current_progspace() -> Progspace | None: ...
def progspaces() -> Sequence[Progspace]: ...
@final
class Progspace:
filename: str
executable_filename: str | None
filename: str | None
symbol_file: Objfile | None
pretty_printers: list[_PrettyPrinterLookupFunction]
type_printers: list[gdb.types._TypePrinter]
frame_filters: dict[str, _FrameFilter]
frame_unwinders: list[gdb.unwinder.Unwinder]
missing_debug_handlers: Incomplete

def block_for_pc(self, pc: int, /) -> Block | None: ...
def find_pc_line(self, pc: int, /) -> Symtab_and_line: ...
def is_valid(self) -> bool: ...
def objfile_for_address(self, address: int, /) -> Objfile | None: ...
def objfiles(self) -> Sequence[Objfile]: ...
def solib_name(self, address: int, /) -> str | None: ...

Expand All @@ -457,6 +494,7 @@ class Objfile:
type_printers: list[gdb.types._TypePrinter]
frame_filters: dict[str, _FrameFilter]
frame_unwinders: list[gdb.unwinder.Unwinder]
is_file: bool

def is_valid(self) -> bool: ...
def add_separate_debug_file(self, file: str) -> None: ...
Expand Down Expand Up @@ -504,6 +542,8 @@ class Frame:
def read_var(self, variable: str | Symbol, /, block: Block | None = ...) -> Value: ...
def select(self) -> None: ...
def level(self) -> int: ...
def static_link(self) -> Incomplete | None: ...
def language(self): ...

# Blocks

Expand Down Expand Up @@ -552,34 +592,31 @@ class Symbol:
def is_valid(self) -> bool: ...
def value(self, frame: Frame = ..., /) -> Value: ...

SYMBOL_UNDEF_DOMAIN: int
SYMBOL_VAR_DOMAIN: int
SYMBOL_STRUCT_DOMAIN: int
SYMBOL_LABEL_DOMAIN: int
SYMBOL_MODULE_DOMAIN: int
SYMBOL_COMMON_BLOCK_DOMAIN: int

# The constants were never correct. Use gdb.SYMBOL_VAR_DOMAIN instead.
SYMBOL_VARIABLES_DOMAIN: int
SYMBOL_FUNCTIONS_DOMAIN: int
SYMBOL_TYPES_DOMAIN: int

SYMBOL_LOC_UNDEF: int
SYMBOL_LOC_CONST: int
SYMBOL_LOC_STATIC: int
SYMBOL_LOC_REGISTER: int
SYMBOL_LOC_ARG: int
SYMBOL_LOC_REF_ARG: int
SYMBOL_LOC_REGPARM_ADDR: int
SYMBOL_LOC_LOCAL: int
SYMBOL_LOC_TYPEDEF: int
SYMBOL_LOC_LABEL: int
SYMBOL_LOC_BLOCK: int
SYMBOL_LOC_CONST_BYTES: int
SYMBOL_LOC_UNRESOLVED: int
SYMBOL_LOC_OPTIMIZED_OUT: int
SYMBOL_LOC_COMPUTED: int
SYMBOL_LOC_COMMON_BLOCK: int
SYMBOL_UNDEF_DOMAIN: Final = 0
SYMBOL_VAR_DOMAIN: Final = 1
SYMBOL_STRUCT_DOMAIN: Final = 2
SYMBOL_MODULE_DOMAIN: Final = 3
SYMBOL_LABEL_DOMAIN: Final = 4
SYMBOL_COMMON_BLOCK_DOMAIN: Final = 5
SYMBOL_TYPE_DOMAIN: Final = 6
SYMBOL_FUNCTION_DOMAIN: Final = 7

SYMBOL_LOC_UNDEF: Final = 0
SYMBOL_LOC_CONST: Final = 1
SYMBOL_LOC_STATIC: Final = 2
SYMBOL_LOC_REGISTER: Final = 3
SYMBOL_LOC_ARG: Final = 4
SYMBOL_LOC_REF_ARG: Final = 5
SYMBOL_LOC_REGPARM_ADDR: Final = 6
SYMBOL_LOC_LOCAL: Final = 7
SYMBOL_LOC_TYPEDEF: Final = 8
SYMBOL_LOC_LABEL: Final = 9
SYMBOL_LOC_BLOCK: Final = 10
SYMBOL_LOC_CONST_BYTES: Final = 11
SYMBOL_LOC_UNRESOLVED: Final = 12
SYMBOL_LOC_OPTIMIZED_OUT: Final = 13
SYMBOL_LOC_COMPUTED: Final = 14
SYMBOL_LOC_COMMON_BLOCK: Final = 15

# Symbol tables

Expand Down Expand Up @@ -658,10 +695,22 @@ class Breakpoint:
temporary: bool
hit_count: int
location: str | None
locations: Incomplete
inferior: int | None
expression: str | None
condition: str | None
commands: str | None

@final
class BreakpointLocation:
address: Incomplete
enabled: bool
fullname: str
function: Incomplete
owner: Incomplete
source: Incomplete
thread_groups: Incomplete

BP_NONE: int
BP_BREAKPOINT: int
BP_HARDWARE_BREAKPOINT: int
Expand Down Expand Up @@ -768,18 +817,26 @@ class ExitedEvent(Event):
exit_code: int
inferior: Inferior

class ThreadExitedEvent(Event): ...
class StopEvent(ThreadEvent): ...

class BreakpointEvent(StopEvent):
breakpoints: Sequence[Breakpoint]
breakpoint: Breakpoint

missing_debug_handlers: list[Incomplete]

class NewObjFileEvent(Event):
new_objfile: Objfile

class FreeObjFileEvent(Event): ...

class ClearObjFilesEvent(Event):
progspace: Progspace

class NewProgspaceEvent(Event): ...
class FreeProgspaceEvent(Event): ...

class SignalEvent(StopEvent):
stop_signal: str

Expand Down Expand Up @@ -815,9 +872,15 @@ class GdbExitingEvent(Event):
class ConnectionEvent(Event):
connection: TargetConnection

class ExecutableChangedEvent(Event): ...

_ET = TypeVar("_ET", bound=Event | Breakpoint | None)

@final
class EventRegistry(Generic[_ET]):
def connect(self, object: Callable[[_ET], object], /) -> None: ...
def disconnect(self, object: Callable[[_ET], object], /) -> None: ...

class ValuePrinter: ...

def blocked_signals(): ...
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy