{"id":24769,"library":"types-gdb","title":"GDB Typing Stubs","description":"Typing stubs for GDB (GNU Debugger) provided by typeshed. Version 16.3.0.20260408 provides type annotations for the gdb Python module, enabling static type checking with mypy or pyright. Stubs are updated weekly to match the latest GDB release.","status":"active","version":"16.3.0.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["gdb","typing","stubs","mypy","typeshed"],"install":[{"cmd":"pip install types-gdb","lang":"bash","label":"Install typing stubs"}],"dependencies":[{"reason":"Runtime package implementing the debugger; stubs are for type-checking only","package":"gdb","optional":true}],"imports":[{"note":"Typeshed packages are imported by their original module name.","wrong":"from typeshed.gdb import *","symbol":"gdb","correct":"import gdb"}],"quickstart":{"code":"import gdb\n\ndef break_handler(event: gdb.BreakpointEvent) -> None:\n    print(f\"Hit breakpoint {event.breakpoint.number}\")\n\ngdb.events.stop.connect(break_handler)\n# Run with: gdb -batch -ex run -ex bt ./some_binary","lang":"python","description":"Register a breakpoint event handler using typed stubs."},"warnings":[{"fix":"Replace 'from gdb.types import ...' with 'import gdb' and use gdb.Type directly.","message":"Importing from 'gdb.types' is deprecated; use 'gdb' directly for type hints.","severity":"deprecated","affected_versions":">=16.0.0"},{"fix":"Upgrade to 16.x and ensure your type hints match the new stub signatures.","message":"Earlier versions may have incorrect signatures for gdb.execute. If using type: ignore or casting, update stubs.","severity":"breaking","affected_versions":"<16.0.0"},{"fix":"Ensure GDB is installed (e.g., 'apt install gdb') separately from the stubs.","message":"These stubs assume the gdb module is available. They only provide type hints and do not install the debugger.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install GDB (e.g., 'apt install gdb' or 'brew install gdb'). The stubs are only for type-checking.","cause":"GDB Python module is not installed; it is part of GDB itself.","error":"ModuleNotFoundError: No module named 'gdb'"},{"fix":"Upgrade types-gdb: 'pip install --upgrade types-gdb'. Use 'import gdb' then reference gdb.Frame.","cause":"Outdated stub version or incorrect import path.","error":"Cannot find reference 'Frame' in 'gdb.py'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}