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

Recognize Breakpoints in Multiple Buffers #2007

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pweibert
Copy link

@pweibert pweibert commented Jan 1, 2023

With this feature debugger will not just interrupt execution at breakpoints in the buffer it was called on (main buffer) but also on breakpoints that were set in other buffers that whose code has been executed by main buffer.

Thus when we set a breakpoint in main.py buffer and one in submodule/mod.py buffer starting the debugger in main will interrupt on execution of main but recognize the breakpoint in submodule/mod.py and interrupt execution.

 main.py
 -- submodule/mod.py

* Traverse open python mode buffers and retrieve breakpoints that were set by elpy
* Specify breakpoints using full file path and line number
@pweibert
Copy link
Author

Any news on this PR? I would really like to use it in my emacs without having to patch the files every time.

@gopar
Copy link
Collaborator

gopar commented Apr 12, 2023

Hey, maintainership for elpy has sadly slowed down with all the maintainers not having enough time. Sadly I don't know much about this area of the code and it has been a while in general since i've done work with elpy. Might not be able to get to this soon

@gopar
Copy link
Collaborator

gopar commented Jul 22, 2023

Hey @pweibert, have you been using this PR for a while? any issues arise? LGTM but want to verify since I'm not using elpy and I am slowly starting to have time to help out again, and would like to get all PR's merged :)

Thx!

@pweibert
Copy link
Author

Hello @gopar, happy to hear that you have time to move some things forward :). Yes, I've tested the code a while and it was stable for me. Let me describe the basic functionality.
Before PR:
When you set breakpoints in multiple files of you project e.g. in module.py and in main.py and start debugging from main: only main.py breakpoints are passed to python debugger pdb .
After PR:
When you set breakpoints in multiple files of you project e.g. in module.py and in main.py and start debugging from main: breakpoints from main.py and module.py are passed to python debugger pdb .

So PR basically takes care that all breakpoints are collected from open buffers and are passed to pdb with file-name and line-number per breakpoint. It is much more convenient to debug the whole project and not just the main file.

elpy-shell.el Outdated Show resolved Hide resolved
elpy-shell.el Outdated Show resolved Hide resolved
docs/ide.rst Outdated
Comment on lines 679 to 680
Run pdb on the current buffer. If no breakpoints has been set in any
open buffer with elpy mode using
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Run pdb on the current buffer. If no breakpoints has been set in any
open buffer with elpy mode using
Run pdb on the current buffer. If no breakpoints have been set in any
open buffer with elpy mode using

@gopar
Copy link
Collaborator

gopar commented Jul 23, 2023

Nice!, left 3 comments. After those are resolve and CI passes, then everything should be good to merge!

@pweibert
Copy link
Author

Changes incorporated!

@pweibert pweibert requested a review from gopar July 24, 2023 08:15
@gopar
Copy link
Collaborator

gopar commented Jul 24, 2023

Ah looks like some tests broke. I'll merge once passing. appreciate the work! \o/

@pweibert
Copy link
Author

pweibert commented Jul 25, 2023 via email

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

Successfully merging this pull request may close these issues.

3 participants