14

Trying to find how to execute ipdb (or pdb) commands such as disable.

Calling the h command on disable says

disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of bp numbers.

So how whould I get those bp numbers? was looking through the list of commands and couldn't get any to display the bp numbers

[EDIT] The break, b and info breakpoints commands don't do anything, although in my module i clearly have 1 breakpoint set like this import pdb; pdb.set_trace( ) - same for ipdb. Moreover info is not defined.

The output of help in pdb:

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

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

Undocumented commands: ====================== retval rv

And for ipdb:

Documented commands (type help ): ======================================== EOF bt cont enable jump pdef psource run unt a c
continue exit l pdoc q s until alias cl
d h list pfile quit step up args clear debug help n pinfo r tbreak w b
commands disable ignore next pinfo2 restart u whatis break condition down j p pp return unalias where

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

Undocumented commands: ====================== retval rv

I have saved my module as pb3.py and am executing it within the command line like this

python -m pb3 The execution does indeed stop at the breakpoint, but within di pdb (ipdb) console, the commands indicated don't display anything - or display a NameError

If more info is needed, i will provide it.

vlad-ardelean
  • 7,480
  • 15
  • 80
  • 124

2 Answers2

12

Use the break command. Don't add any line numbers and it will list all instead of adding them.

tayfun
  • 3,065
  • 1
  • 19
  • 23
  • 2
    What is your python and ipdb version? – ssoto Nov 05 '15 at 09:47
  • `ipdb` interfaces with `ipython` and tries to have the same interface as `pdb` which comes with python 2 & 3. Here are the documentation for it: https://docs.python.org/3/library/pdb.html#pdbcommand-break and https://docs.python.org/2/library/pdb.html#pdbcommand-break I'm using Python3.6 with `ipdb==0.11` – tayfun May 21 '18 at 08:15
  • `python 3.7.8,` am I using IPDB? – Carbon Nov 10 '20 at 17:32
-3

info breakpoints

or just

info b

lists all breakpoints.

War10ck
  • 12,387
  • 7
  • 41
  • 54
jpmuc
  • 1,092
  • 14
  • 30