Skip to main content

Modular Python Debugger

Project description

This is a rewrite of the Python debugger, pydb.py (http://bashdb.sf.net/pydb), itself a derivative of the stock Python debugger pdb.

This code makes assumes Python in the version range of 2.5 up to and not including 3K. Use pydb for Python 2.5 and earlier.

Some of the core routines include handling code stepping, implementing breakpoints (setting/removing them and checking whether one has occurred), and registering/unregistering a code to be debugged. The intention is that IDE frameworks like Eclipse, Aptana or Netbeans and alternative Python implementation should be able to use pieces of the debugger as they see fit.

The command API portion of the debugger is largely modeled on the GNU GDB model. A command-line interface (CLI) is provided as well as code for remote debugging

There’s a lot of cool stuff here that’s not in pydb.

  • Syntax colorization of source code and use of terminal highlighting Of course, this can be turned off.

  • out-of-process debugging. You can now debug your program in a different process or even a different computer on a different network

  • Better stepping granularity. Sometimes you want small steps, and sometimes large stepping. This fundamental issue is handled in a couple ways:

    • step+, step-, next+, next- commands. These force stepping/nexting to a different line. “set different” does this globally.

    • step>, step<, step!, next>, etc commands. Set the next step event to be something other than a “line” event such as a call, return or exception

    • one can set a filter set. If you just want to stop at line events (which is largely what you happens in pdb) you can. If however you just want to stop at calls and returns, and exceptions you can. Or pick some combination.

    • “set skip”. Ths cause statements I think you usually want to skip over such as function and class definition statement. This is turned on by default, but if you do want to stop here and get the full story you can.

  • In conjunction with handling all events by default, the event status is shown when stopped. The reason for stopping is also available via “info program”.

  • event tracing of calls and returns. I’m not sure why this was not done before. Probably because of the lack of the ability to set and move by different granularities, tracing calls and returns lead to too many unintersting stops (such as at the same place you just were at). Also, stopping on function definitions probably also added to this tedium.

    Because we are really handling return events, we can show you the return value. (pdb has an undocumented “retval” command that in fact doesn’t work.)

  • We do more in the way of looking at the bytecodes to give better information. Through this we can provide:

    • a “skip” command. It is like the “jump” command, but you don’t have to deal with line numbers. Sorry, no “hop” command yet.

    • disassembly of code fragments. You can now disassemble relative to the stack frames you are currently stopped at.

    • Better interpretation of where you are when inside execfile or exec. (But really though this is probably a Python compiler misfeature.)

    • Check that breakpoints are set only where they make sense (via magic in the package “coverage”.)

    • A more accurate determination of if you are at a function-defining “def” statement (because the caller instruction contains “MAKE_FUNCTION”.)

  • Debugger command arguments can be variables

Commands that take integer arguments like “up” “list” or “disassemble” allow you to use a Python expression including local or global variables that evaluates to an integer.

  • egg installable.

  • Debugger plays nice with other trace hooks. You can have several debugger objects.

  • These don’t directly effect end-users, but if you are developing the code they do. And keeping developers happy is a good thing. TM

    • more modulular.

      o Commands and subcommands are individual classes now, not methods

      in a class. This means they now have properties like the context in which they can be run, minimum abbreviation name or alias names. To add a new command you basically add a file in a directory.

      o I/O is it’s own layer. This simplifies interactive readline

      behavior from reading commands over a TCP socket.

      o An interface is it’s own layer. Local debugging, remote

      debugging, running debugger commands from a file (“source”) are different interfaces. This means, for example, that we are able to give better error reporting if a debugger command file has an error.

    • more testable. Much more unit and functional tests. More of pydb’s integration test will eventually be added.

Of course, I think pydb has a number of cool things that are not in the stock Python debugger, pdb. See http://bashdb.sourceforge.net/pydb/features.html for details.

Project details


Download files

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

Source Distributions

trepan-0.2.8.tar.gz (130.8 kB view details)

Uploaded Source

trepan2-0.2.8.tar.gz (174.2 kB view details)

Uploaded Source

Built Distributions

trepan-0.2.8-py3.3.egg (517.5 kB view details)

Uploaded Source

trepan-0.2.8-py3.2.egg (508.8 kB view details)

Uploaded Source

trepan-0.2.8-py2.7.egg (521.6 kB view details)

Uploaded Source

trepan-0.2.8-py2.6.egg (523.1 kB view details)

Uploaded Source

trepan-0.2.8-py2.5.egg (523.6 kB view details)

Uploaded Source

trepan-0.2.8-py2.4.egg (527.5 kB view details)

Uploaded Source

File details

Details for the file trepan-0.2.8.tar.gz.

File metadata

  • Download URL: trepan-0.2.8.tar.gz
  • Upload date:
  • Size: 130.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8.tar.gz
Algorithm Hash digest
SHA256 45a76180a41ac30d666e2671622b4ccbd05cd5eb365bfeaf5b32939873eb3293
MD5 216a9ee0e60df183a4c90e412d0cbf37
BLAKE2b-256 e6d8d22a234f95173e404b455b0e89a80a8f3e1784fedc01ca42d9f88f7b0fff

See more details on using hashes here.

Provenance

File details

Details for the file trepan2-0.2.8.tar.gz.

File metadata

  • Download URL: trepan2-0.2.8.tar.gz
  • Upload date:
  • Size: 174.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan2-0.2.8.tar.gz
Algorithm Hash digest
SHA256 b7770c27a822e8c48241a54c1d1db1a92b832bc276e734197c618f11c9509f58
MD5 e91d3e2bba0c93aa203fc10af0bd58c1
BLAKE2b-256 9ad20b1d31528d8bba6d061c934b17ef03b0a9e71482e5e6c94fdb62f8f5f9b2

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py3.3.egg.

File metadata

  • Download URL: trepan-0.2.8-py3.3.egg
  • Upload date:
  • Size: 517.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py3.3.egg
Algorithm Hash digest
SHA256 9c43252fe8d24bbc3d31a5e1587fe9213eec1e3bea5bde5e855df708e3d66e48
MD5 903cdfbb7cb1e2b866b308e54249ad3d
BLAKE2b-256 bb3e57f39ddf332e7d423d4397850471d42c7697a8cd729741bae3990b67dab5

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py3.2.egg.

File metadata

  • Download URL: trepan-0.2.8-py3.2.egg
  • Upload date:
  • Size: 508.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py3.2.egg
Algorithm Hash digest
SHA256 4c8b649be1f4f5c520096ca406b21aa3351b291bf602c929d11ad71823383f68
MD5 8c9416472c135884fe5a1ba053578db7
BLAKE2b-256 1c1ac23dbd9b7d6a929a93c1a27d0b95d87455a60cfea8b600c5b0e78c7f3b55

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py2.7.egg.

File metadata

  • Download URL: trepan-0.2.8-py2.7.egg
  • Upload date:
  • Size: 521.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py2.7.egg
Algorithm Hash digest
SHA256 2fd4998ddb9e4d518752a03271203db3bd4cf2566cd5e91778b8af2049f933e2
MD5 f92bdfad1dcf3d610b0f7b3463905cd7
BLAKE2b-256 5064a8c7ba1d884eb7abc2785268c29cddf9e294e7a5766ee743605bf01b5144

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py2.6.egg.

File metadata

  • Download URL: trepan-0.2.8-py2.6.egg
  • Upload date:
  • Size: 523.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py2.6.egg
Algorithm Hash digest
SHA256 3eb56427b46437b7e11b809672f02338c325a8c606a249bfb8d2020350170557
MD5 6dee0a247fb2b817f448095cff821f5f
BLAKE2b-256 a945abaca9c2866c527fe9180ec1f0755aaf883e935ec328d5f7c5cd134e5d01

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py2.5.egg.

File metadata

  • Download URL: trepan-0.2.8-py2.5.egg
  • Upload date:
  • Size: 523.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py2.5.egg
Algorithm Hash digest
SHA256 a03e090e5bcd8ec94da67ad2da2586e56980b09be4c71328f85358ac06f66974
MD5 7b729511f4f26a9d63f05a413f3db1a9
BLAKE2b-256 89c1be150689bd920c3a0da155b285841126f5906ed1b51eef8f0858f5a26748

See more details on using hashes here.

Provenance

File details

Details for the file trepan-0.2.8-py2.4.egg.

File metadata

  • Download URL: trepan-0.2.8-py2.4.egg
  • Upload date:
  • Size: 527.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trepan-0.2.8-py2.4.egg
Algorithm Hash digest
SHA256 6a62b1d6991e778c9aa084a292a23dc5dbcb6801d6d8601226a0d29778756e70
MD5 0837d38b681ccafbe8395426699505df
BLAKE2b-256 ea2ab80ebac85119c594e3641580f1d0c4dff999c32e72c25148a90373fc1ee3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page