Stéphane Wirtel <steph...@wirtel.be> added the comment:

Hi David,

It's my fault and you are right, I didn't give the right description.

By default when you want to list the source code with pdb, you will use the 
list command but this one is just limited to the 10 next lines and there is no 
possibility to change this limit of 10 lines.

We can play with the second parameter of pdb, examples:

* list 10, 11
will show the code from the line 10 to 11

* list 10, 50
will show the code from the line 10 to 50

* list 10, 5
will show the code from the line 10 and the next 5 lines.

* list
will show from the current position and the next 10 lines.

and my first question was, why this limit exists? Could we change that?

after, I have read the doc of gdb and I have seen there was a "set linesize 
count" option where you can configure the number of lines to show.

Here is the reason of my proposal.

For the configuration of pdb, I am interested, I know we can use the .pdbrc 
file but it is really interesting if we desire to add new aliases or add new 
commands for the breakpoints.


Here is an other example for this issue:

./python -m pdb demo.py
 
> demo.py(1)<module>()
-> import os
(Pdb) listsize 5
List size: 5
(Pdb) l
  1  -> import os
  2     import sys
  3     
  4     def main():
  5         print(f"CWD: {sys.getcwd()}")
  6         print(f"PID: {sys.getpid()}")
(Pdb) l
  7     
  8     if __name__ == '__main__':
  9         main()
[EOF]
(Pdb)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31607>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to