There's more...

The list of commands with which you can interact with in rpdb can be displayed by typing the help command from the Pdb prompt:

> c:usersgiancarlodesktoppython parallel programming cookbook 2nd editionpython parallel programming new bookchapter_x- code debugging
pdb_code_example.py(7)<module>()
-> def my_func(thread_number):
(Pdb) help

Documented commands (type help <topic>):
========================================
EOF c d h list q rv undisplay
a cl debug help ll quit s unt
alias clear disable ignore longlist r source until
args commands display interact n restart step up
b condition down j next return tbreak w
break cont enable jump p retval u whatis
bt continue exit l pp run unalias where

Miscellaneous help topics:
==========================
pdb exec

(Pdb)

Among the most useful commands, this is how we insert the breakpoints in the code:

  1. Type b and the line number to set a breakpoint. Here, a breakpoint is set in lines 5 and 10:
 (Pdb) b 5
Breakpoint 1 at c:usersgiancarlodesktoppython parallel programming cookbook 2nd editionpython parallel programming new bookchapter_x- code debugging pdb_code_example.py:5
(Pdb) b 10
Breakpoint 2 at c:usersgiancarlodesktoppython parallel programming cookbook 2nd editionpython parallel programming new bookchapter_x- code debugging pdb_code_example.py:10
  1. It is sufficient to type the b command to display the list of breakpoints implemented:
 (Pdb) b
Num Type Disp Enb Where
1 breakpoint keep yes at c:usersgiancarlodesktoppython parallel programming cookbook 2nd editionpython parallel programming new bookchapter_x- code debugging pdb_code_example.py:5
2 breakpoint keep yes at c:usersgiancarlodesktoppython parallel programming cookbook 2nd editionpython parallel programming new bookchapter_x- code debugging pdb_code_example.py:10
(Pdb)

At each new breakpoint added, a numeric identifier is assigned. These identifiers are used to enable, disable, and interactively remove breakpoints. To disable a breakpoint, use the disable command, which tells the debugger not to stop when that line is reached. The breakpoint is not forgotten but is ignored.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset