or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

core-debugging.mdfile-system.mdframework-integration.mdindex.mdinteractive-console.mdipython-integration.mdprocess-attachment.mdprogrammatic-api.md
tile.json

tessl/pypi-pydevd

Comprehensive Python debugger backend for IDEs with remote debugging, breakpoints, variable inspection, and performance optimizations

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pydevd@3.3.x

To install, run

npx @tessl/cli install tessl/pypi-pydevd@3.3.0

index.mddocs/

PyDevD

A comprehensive Python debugger backend that serves as the core debugging engine for multiple popular IDEs including PyDev for Eclipse, PyCharm, and VSCode Python extensions. PyDevD provides advanced debugging capabilities including remote debugging, breakpoint management, variable inspection, step-by-step execution control, and frame evaluation with optimized performance through Cython speedups and Python 3.12 sys.monitoring support.

Package Information

  • Package Name: pydevd
  • Language: Python
  • Installation: pip install pydevd
  • License: EPL (Eclipse Public License)
  • Python Versions: 3.6+

Core Imports

import pydevd

For file utilities:

import pydevd_file_utils

For interactive console:

import pydevconsole

For programmatic API control:

from _pydevd_bundle.pydevd_api import PyDevdAPI

Basic Usage

Remote Debugging Setup

import pydevd

# Connect to debugger server (typically running in IDE)
pydevd.settrace('localhost', port=5678)

# Your code here - execution will pause at first line
x = 42
y = x * 2
print(f"Result: {y}")

# Stop debugging
pydevd.stoptrace()

Configuration and Logging

import pydevd

# Configure debugger protocol and logging
pydevd.config(protocol='http', debug_mode='True')
pydevd.log_to('/path/to/debugger.log', log_level=2)

# Start debugging with custom settings
pydevd.settrace(
    host='192.168.1.100',
    port=5678,
    suspend=True,
    trace_only_current_thread=False,
    patch_multiprocessing=True
)

Architecture

PyDevD follows a modular architecture designed for flexibility and performance:

  • Core Debugger (pydevd.py): Main debugging session management and control interface
  • Communication Layer: Handles protocol communication between debugger and IDE
  • Tracing Infrastructure: Low-level Python tracing hooks and frame evaluation
  • File System Integration: Cross-platform path handling and source file management
  • Plugin System: Framework-specific debugging extensions (Django, Jinja2)
  • Performance Optimizations: Cython extensions and sys.monitoring for Python 3.12+

This design enables PyDevD to serve as the universal debugging backend for Python development across different IDEs and environments.

Capabilities

Core Debugging Interface

Primary debugging functionality including session management, tracing control, configuration, and logging. These functions provide the main interface for starting, stopping, and configuring debugging sessions.

def settrace(host=None, stdout_to_server=False, stderr_to_server=False, port=5678, suspend=True, trace_only_current_thread=False, overwrite_prev_trace=False, patch_multiprocessing=False, stop_at_frame=None, block_until_connected=True, wait_for_ready_to_run=True, dont_trace_start_patterns=(), dont_trace_end_patterns=(), access_token=None, client_access_token=None, notify_stdin=True, protocol=None, **kwargs): ...
def stoptrace(): ...
def config(protocol="", debug_mode="", preimport=""): ...
def log_to(log_file: str, log_level=3): ...

Core Debugging

File System Utilities

Cross-platform file path handling, normalization, and client-server path translation for remote debugging scenarios. Essential for handling source file references across different environments.

def canonical_normalized_path(filename): ...
def absolute_path(filename): ...
def normcase(s): ...
def get_client_filename_source_reference(client_filename): ...
def get_server_filename_from_source_reference(source_reference): ...

File System

Interactive Console

Interactive debugging console interface for code evaluation and inspection during debugging sessions. Provides REPL-like functionality within the debugging context.

class Command: ...
# Console classes from _pydevd_bundle.pydevconsole_code

Interactive Console

Programmatic API Control

Advanced programmatic interface for controlling debugger behavior, managing breakpoints, and handling debugging events. Used by IDEs and tools that need fine-grained control over debugging sessions.

class PyDevdAPI:
    def add_breakpoint(self, py_db, original_filename, breakpoint_type, breakpoint_id, line, condition, func_name, expression, suspend_policy, hit_condition, is_logpoint, adjust_line=False, on_changed_breakpoint_state=None): ...
    def remove_breakpoint(self, py_db, received_filename, breakpoint_type, breakpoint_id): ...
    # Additional API methods for thread control, variable inspection, and debugging

Programmatic API

Process Attachment

Remote process attachment and code injection capabilities for debugging already-running Python processes. Enables debugging scenarios where the target process wasn't started with debugging enabled.

# Functions from pydevd_attach_to_process.add_code_to_python_process
def run_python_code(pid, python_code, connect_debugger_tracing=False, show_debug_info=0): ...

Process Attachment

Framework Integration

Plugin system for framework-specific debugging support including Django templates, Jinja2 templates, and custom debugging extensions. Provides specialized debugging capabilities for web frameworks and template engines.

# Django debugging support
# Jinja2 template debugging support
# Custom plugin extension framework

Framework Integration

IPython Integration

Integration with IPython kernels and GUI toolkits for debugging interactive computing environments. Supports matplotlib, Qt applications, and other GUI frameworks commonly used in scientific computing.

# IPython kernel integration
# GUI toolkit event loop management
# Matplotlib integration utilities

IPython Integration

Types

Core Types

class PyDB:
    """Main debugging session management class."""
    def __init__(self, set_as_global=True): ...
    def trace_dispatch(self, frame, event, arg): ...
    def set_suspend(self, thread, stop_reason): ...
    def do_wait_suspend(self, thread, frame, event, arg): ...

class SetupHolder:
    """Debugger configuration holder."""
    setup: dict

class DebugInfoHolder:
    """Debug configuration and state container."""
    default_stop_on_unhandled_exception: bool
    default_stop_on_handled_exception: bool

Breakpoint Types

class ExceptionBreakpoint:
    """Exception breakpoint configuration."""
    def __init__(self, qname, condition, expression, notify_on_handled_exceptions, notify_on_unhandled_exceptions, notify_on_first_raise_only): ...

class LineBreakpoint:
    """Line-based breakpoint configuration."""
    def __init__(self, line, condition, expression, suspend_policy, hit_condition, is_logpoint): ...

Constants

# Debugger states
STATE_RUN = 1
STATE_SUSPEND = 2

# Suspend types
PYTHON_SUSPEND = 1
DJANGO_SUSPEND = 2
JINJA2_SUSPEND = 3

# Platform detection
IS_CPYTHON: bool
IS_IRONPYTHON: bool
IS_WINDOWS: bool
IS_LINUX: bool
IS_MAC: bool

# Configuration limits
MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 1000