How to find the breakpoint numbers in pdb (ipdb)?
Asked Answered
R

1

15

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.

Rew answered 5/2, 2014 at 16:10 Comment(1)
I'm trying disable breakpoints but no info is printed.Villa
A
13

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

Arhna answered 5/2, 2014 at 16:13 Comment(3)
What is your python and ipdb version?Villa
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: docs.python.org/3/library/pdb.html#pdbcommand-break and docs.python.org/2/library/pdb.html#pdbcommand-break I'm using Python3.6 with ipdb==0.11Arhna
python 3.7.8, am I using IPDB?Sim

© 2022 - 2024 — McMap. All rights reserved.