Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Mechanism to automatically show N lines of context at each debugger-stop #473

Open
zachriggle opened this issue Oct 9, 2021 · 3 comments

Comments

@zachriggle
Copy link

I really like ipdb, which is built on and uses a lot of ipython features!

Unfortunately, some portion of ipdb or ipython does NOT like to play nice when embedded inside LLDB to debug LLDB Python scripts. Everything works the first time, then all Python is broken after that.

pdbpp on the other hand seems to work well! pdbpp has the sticky view which is REALLY cool, but overkill for some uses and detrimental for others (e.g. stepping over a print statement, you won't see the output).

Is there a way to configure pdbpp to show N lines of context before / after the current line, on every debugger stop? This is the equivalent of hitting l on each stop. I'm digging through the pdbpp internals now to sort it out, but I figured it was worth asking if it might save some time.

@blueyed
Copy link
Collaborator

blueyed commented Oct 10, 2021

There's no such option yet.
Try the master branch for fixes/improvements with regard to (not) hiding prints.

I could imagine that the option would be applied to sticky mode, where you then set the maximum context lines before/after/around the current line. Does that make sense?
Currently this is limited to the number of screen lines already, taking into account extra output via pdb's msg mechanism additionally.

@zachriggle
Copy link
Author

I'm in the process of switching from ipdb (based on IPython) to pdb++ because the former breaks everything in LLDB.

ipdb has a nice option for lines-of-context-displayed-at-each-breakpoint-or-debugger-step, it would be nice to have this functionality in pdbpp.

@mdmintz
Copy link

mdmintz commented Nov 22, 2022

This particular change would be helpful, as I am in the process of swapping ipdb with pdbpp (pdb++) in SeleniumBase. seleniumbase/SeleniumBase#1615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants