Package logilab :: Package common :: Module debugger :: Class Debugger

[frames] | no frames]

# Class Debugger

source code

    bdb.Bdb --+
              |
    cmd.Cmd --+
              |
        pdb.Pdb --+
                  |
                 Debugger

    custom debugger

    - sets up a history file
    - uses ipython if available to colorize lines of code
    - overrides list command to search for current block instead
      of using 5 lines of context

Instance Methods

__init__(self, tcbk=None) Instantiate a line-oriented interpreter framework. | source code

setup_history_file(self) if readline is available, read pdb history file... | source code

start(self) starts the interactive mode | source code

setup(self, frame, tcbk) setup hook: set up history file | source code

set_quit(self) quit hook: save commands in the history file | source code

complete_p(self, text, line, begin_idx, end_idx) provide variable names completion for the ``p`` command | source code

attr_matches(self, text, namespace) implementation coming from rlcompleter.Completer.attr_matches Compute matches when text contains a dot. | source code

get_class_members(self, klass) implementation coming from rlcompleter.get_class_members | source code

do_list(self, arg) overrides default list command to display the surrounding block... | source code

do_l(self, arg) overrides default list command to display the surrounding block... | source code

do_open(self, arg) opens source file corresponding to the current stack level | source code

do_o(self, arg) opens source file corresponding to the current stack level | source code

Inherited from `pdb.Pdb`: `bp_commands`, `checkline`, `default`, `defaultFile`, `displayhook`, `do_EOF`, `do_a`, `do_alias`, `do_args`, `do_b`, `do_break`, `do_bt`, `do_c`, `do_cl`, `do_clear`, `do_commands`, `do_condition`, `do_cont`, `do_continue`, `do_d`, `do_debug`, `do_disable`, `do_down`, `do_enable`, `do_exit`, `do_ignore`, `do_j`, `do_jump`, `do_n`, `do_next`, `do_p`, `do_pp`, `do_q`, `do_quit`, `do_r`, `do_restart`, `do_return`, `do_retval`, `do_run`, `do_rv`, `do_s`, `do_step`, `do_tbreak`, `do_u`, `do_unalias`, `do_unt`, `do_until`, `do_up`, `do_w`, `do_whatis`, `do_where`, `execRcLines`, `forget`, `handle_command_def`, `help_EOF`, `help_a`, `help_alias`, `help_args`, `help_b`, `help_break`, `help_bt`, `help_c`, `help_cl`, `help_clear`, `help_commands`, `help_condition`, `help_cont`, `help_continue`, `help_d`, `help_debug`, `help_disable`, `help_down`, `help_enable`, `help_exec`, `help_exit`, `help_h`, `help_help`, `help_ignore`, `help_j`, `help_jump`, `help_l`, `help_list`, `help_n`, `help_next`, `help_p`, `help_pdb`, `help_pp`, `help_q`, `help_quit`, `help_r`, `help_restart`, `help_return`, `help_run`, `help_s`, `help_step`, `help_tbreak`, `help_u`, `help_unalias`, `help_unt`, `help_until`, `help_up`, `help_w`, `help_whatis`, `help_where`, `interaction`, `lineinfo`, `lookupmodule`, `onecmd`, `precmd`, `print_stack_entry`, `print_stack_trace`, `reset`, `user_call`, `user_exception`, `user_line`, `user_return`

Inherited from `bdb.Bdb`: `break_anywhere`, `break_here`, `canonic`, `clear_all_breaks`, `clear_all_file_breaks`, `clear_bpbynumber`, `clear_break`, `dispatch_call`, `dispatch_exception`, `dispatch_line`, `dispatch_return`, `format_stack_entry`, `get_all_breaks`, `get_break`, `get_breaks`, `get_file_breaks`, `get_stack`, `is_skipped_module`, `run`, `runcall`, `runctx`, `runeval`, `set_break`, `set_continue`, `set_next`, `set_return`, `set_step`, `set_trace`, `set_until`, `stop_here`, `trace_dispatch`

Inherited from `cmd.Cmd`: `cmdloop`, `columnize`, `complete`, `complete_help`, `completedefault`, `completenames`, `do_help`, `emptyline`, `get_names`, `parseline`, `postcmd`, `postloop`, `preloop`, `print_topics`

Class Variables
Inherited from `pdb.Pdb`: `commands_resuming`, `do_h` Inherited from `cmd.Cmd`: `doc_header`, `doc_leader`, `identchars`, `intro`, `lastcmd`, `misc_header`, `nohelp`, `prompt`, `ruler`, `undoc_header`, `use_rawinput`

Method Details

### __init__(self, tcbk=None)
(Constructor)

source code

Instantiate a line-oriented interpreter framework.

The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically. The optional arguments stdin and stdout specify alternate input and output file objects; if not specified, sys.stdin and sys.stdout are used.

Overrides: cmd.Cmd.__init__
  (inherited documentation)

### setup_history_file(self)

source code

    if readline is available, read pdb history file

### setup(self, frame, tcbk)

source code

    setup hook: set up history file

Overrides: pdb.Pdb.setup

### set_quit(self)

source code

    quit hook: save commands in the history file

Overrides: bdb.Bdb.set_quit

### attr_matches(self, text, namespace)

source code

    implementation coming from rlcompleter.Completer.attr_matches
    Compute matches when text contains a dot.

    Assuming the text is of the form NAME.NAME....[NAME], and is
    evaluatable in self.namespace, it will be evaluated and its attributes
    (as revealed by dir()) are used as possible completions.  (For class
    instances, class members are also considered.)

    WARNING: this can still invoke arbitrary C code, if an object
    with a __getattr__ hook is evaluated.

### do_list(self, arg)

source code

    overrides default list command to display the surrounding block
    instead of 5 lines of context

Overrides: pdb.Pdb.do_list

### do_l(self, arg)

source code

    overrides default list command to display the surrounding block
    instead of 5 lines of context

Overrides: pdb.Pdb.do_list