Skip to main content

Enable various PDB debugging when debug-mode=on

When Zope is running in debug mode this product hooks PDB debugging into various parts of a Zope instance. Some additional Plone specific hooks are also included.

Requirements

PDBDebugMode has been tested with Zope 2.8.5 and 2.10 but may well work with other versions.

Its recommended that you use an editor or IDE that can cooperate with pdb. Emacs for example, will display the corresponding lines of the source file alongside the pdb prompt.

Remember that this product does nothing unless zope is being run with debug-mode=on such as with “instance/bin/zopectl fg”

Post-Mortem Debugging

To provide for better investigation of errors, any error or exception logged with the python logging module will invoke pdb.post_mortem() if a traceback can be retrieved and pdb.set_trace() will be invoked otherwise. Since the Zope error_log exception handler uses the logging module when logging errors, this provides for post mortem debugging of Zope errors. It is often useful, for example, to remove NotFound or Unauthorized from the ignored exception in error_log and then investigate such errors with PDB.

Runcall Requests

Any request that has the key ‘pdb_runcall’ will call the result of the request traversal in the debugger thus allowing for stepping through the resulting execution. To debug a POST or any other request which might be tricky to insert the ‘pdb_runcall’ key into, use ‘?toggle_runcall=1’ at the end of a URL immediately preceding the POST to set a ‘pdb_runcall’ cookie which will then invoke the pdb.runcall when the POST is submitted. Use ‘?toggle_runcall=1’ at the end of a URL to clear the cookie. Remember that the cookie will be set at the level in the hierarchy that it was set.

Alternatively, a view named ‘pdb’ is registered for all objects that will simply raise an exception leaving you with the current context to inspect.

Allow Import of pdb

Import of the pdb module is also allowed in unprotected code such as python scripts.

Changelog

0.3 - 2009-04-08

  • Use collective.monkeypatcher to move all patches into ZCML

  • Fully deprecate the Zope exception handler in favor of the logging hook since the Zope exception handler uses the logging module anyways and more can be done by hooking at that level.

  • Handle failed matches in Products.PDBDebugMode.pdblogging more gracefully

  • More flexible log matching. Change Products.PDBDebugMode.pdblogging.ignore_regexes to ignore_matchers and accept any callable.

0.2 - 2008-05-15

  • Eggified

0.1 - 2006-03-11

  • Initial release

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Products.PDBDebugMode-0.3.tar.gz (13.4 kB view details)

Uploaded Source

File details

Details for the file Products.PDBDebugMode-0.3.tar.gz.

File metadata

File hashes

Hashes for Products.PDBDebugMode-0.3.tar.gz
Algorithm Hash digest
SHA256 74a743f3660a4bbe3903686c9b5f5b3945b2e2f6e3da780aa295b5866be5dd6f
MD5 5a27bcbfb360a8a68ca5ebd7217ba5ae
BLAKE2b-256 7f7cc7f9eb5a47e23475398927294050515a9f9f983da0d5373f58bdb7184a2f

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0.0

2 files

2.1

2 files

2.0

1 file

1.4

1 file

1.3.1

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0

1 file

This release

0.3 This release

1 file

0.2

1 file

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