Issue31607
Created on 2017-09-27 10:22 by matrixise, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3787 | closed | matrixise, 2017-09-27 10:39 | |
| Messages (6) | |||
|---|---|---|---|
| msg303123 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2017-09-27 10:22 | |
I just added a new command for the prompt of Pdb. (Pdb) listsize List size: 10 (Pdb) listsize 5 List size: 5 (Pdb) listsize List size: 5 I will publish a PR |
|||
| msg303136 - (view) | Author: R. David Murray (r.david.murray) * ![]() |
Date: 2017-09-27 13:07 | |
It isn't obvious from your description here what 'listsize' does. I think you should have provided some more motivating details :) Looking at your PR, this is essentially a configuration setting. I wonder if we should think about the general problem rather than continuing to clutter the top level command namespace. (The only current example of this I spotted in the pdb docs is display/undisplay.) |
|||
| msg303138 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2017-09-27 13:17 | |
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)
|
|||
| msg303157 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2017-09-27 15:19 | |
I don't think this is worth adding a separate command. If some controls were needed (changing the list size has not been requested before), it may be better to follow gdb with set/get commands that could be used for other parameters as well. |
|||
| msg303206 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2017-09-28 10:03 | |
Raymond, +1 for the set/get commands for the parameters. I could update my PR with your suggestions. Stephane |
|||
| msg316515 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2018-05-14 14:58 | |
I close this issue because I think we need to use a pair of set/get and not a new command like 'listsize'. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:52 | admin | set | github: 75788 |
| 2018-05-14 14:58:26 | matrixise | set | status: open -> closed messages:
+ msg316515 |
| 2017-09-28 10:03:23 | matrixise | set | messages: + msg303206 |
| 2017-09-27 15:19:41 | rhettinger | set | nosy:
+ rhettinger messages: + msg303157 |
| 2017-09-27 13:17:48 | matrixise | set | messages: + msg303138 |
| 2017-09-27 13:07:50 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg303136 |
| 2017-09-27 10:39:22 | matrixise | set | keywords:
+ patch stage: patch review pull_requests: + pull_request3772 |
| 2017-09-27 10:22:08 | matrixise | create | |
