Skip to main content

dbghelper

Convenience method for manually inserting tracepoints into code that support multiple debuggers

import dbg ; dbg.D()

as an alternative to:

import pdb ; pdb.set_trace()

This supports multiple debuggers; currently pdb (or Pdb++ if installed), winpdb, and pydevd (which is used inside both PyDev and PyCharm).

Selecting the debugger

The debugger desired can be selected by setting the environment variable PYDBG. The following are valid values:

  • pydevd or pycharm will use pydevd locally (if running in debug mode) or remotely if not

  • pydevd_remote or pycharm_remote will use pydevd remotely

  • pydevd_local or pycharm_local will use pydevd locally, and warn if not running in debug mode

  • winpdb will use winpdb

  • pdb will use pdb (default)

An environment variable is used so that imports of the debugger libraries can be determined at import time.

Inserting a tracepoint

Call dbg.D() to insert a tracepoint in the code; the appropriate debugger should launch when that line of code is executed, ready to execute the following line.

A thread-safe version dbg.tsD()``is also supported. This is only different when using ``pdb; in that case multiple threads having tracepoints (for example, in a web server) can cause confusion as multiple debug sessions get attached to the same console. The tsD implementation uses a lock to only allow one debug session to use the console at once; other sessions are not allowed the lock until the debug interaction is finished (e.g. typing c for continue).

Parameters for debuggers

Some debuggers have parameters that can be set using environment variables, or at runtime.

pydevd implementation will use the value of the environment variables PYDEVD_HOST for hostname and PYDEVD_PORT for port when connecting remotely by default. These can also be adjusted on by setting dbg.pydevd_args.host and dbg.pydevd_args.port at runtime.

Metadata

Release files for dbghelper 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbghelper 0.3
File Size Uploaded Provenance Actions
dbghelper-0.3.tar.gz 4.2 kB Without provenance Details for dbghelper-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbghelper 0.3
File Interpreter ABI Platform Actions
dbghelper-0.3-py2.7.egg Legacy Egg format - - Details for dbghelper-0.3-py2.7.egg

Total release size: 11.9 kB

Release files / dbghelper-0.3.tar.gz

Download URL dbghelper-0.3.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
09c4c537ff485811598e269568261093984054fdc61dbfc548a98f9349af0acb
BLAKE2b-256 checksum
How to use checksums
ccaf1c552a9b7a3eadfcbb86d0b5b81c9c313cff399c22ef43621f6eb927b428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dbghelper-0.3-py2.7.egg

Download URL dbghelper-0.3-py2.7.egg
Size 7.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
11fed4a2bf635efb38d4d01044cd5b60579a1db8c5b6f7aeea8f605223f1777c
BLAKE2b-256 checksum
How to use checksums
0edeba0b351a91d3cf4a83bbdebc74d23a09a718bf2a4c20cfc56f3279a84fae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for dbghelper 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page