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

added vim-like count feature for certain commands #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dohsimpson
Copy link

see issue #140
supported commands: run to cursor; movements(j/k/h/l); stack movements(u/d)
Bug: UI is not correctly updated if program terminated after count command

see issue inducer#140
supported commands: run to cursor; movements(j/k/h/l);
stack movements(u/d)
Bug: UI is not correctly updated at the program termination
@asmeurer
Copy link
Collaborator

Is it possible to make it work with arrow keys too?

@asmeurer
Copy link
Collaborator

Should we add some kind of indicator to the UI so the user can see what number they've typed?

@asmeurer
Copy link
Collaborator

Seems like s and n should be supported as well.

existing_breaks = self.debugger.get_breaks(bp_source_identifier, pos+1)
if existing_breaks:
assert len(existing_breaks) == 1,\
"Expect one breakpoint at line %d, got %d" % (pos+1, len(existing_breaks))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I got this error. I think it occurs when you use t on a line that is already set as a breakpoint.

Copy link
Author

Choose a reason for hiding this comment

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

Hi asmeurer, thanks for the feedback. It's not obvious to me how to solve this. The normal breakpoint alway break therefore makes the ignore count of temporary breakpoint useless.
I think that a possible solution would be to disable the normal breakpoint and reenable them after the temporary breakpoints used. But it seems that there's no clean way to do it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think only temporary breakpoints should be ignored, right? Is there some way to not ignore manually set breakpoints?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure I understand your statement correctly. Manually set breakpoint are never ignored and breaks each time it's met, and therefore would interfere with temporary breakpoint that are set to be ignored for a specified times.

@dohsimpson
Copy link
Author

The count function is only registered in the listener of DebuggerUI.source_sigwrap, which doesn't have control of "Up" and "Down". But I think it's doable if we register it as a top level listener.

I agree that UI indicator would be great. But I'm not very familiar with pudb's UI codebase, so I would need some help on that.

Unfortunately s and n does not use Breakpoint and thus there's no API for adding ignore count.

Base automatically changed from master to main March 8, 2021 02:14
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.

None yet

2 participants