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 about something with setBreakPointsRequest #18

Open
StephenBloomquist opened this issue Jan 25, 2017 · 5 comments
Open

Question about something with setBreakPointsRequest #18

StephenBloomquist opened this issue Jan 25, 2017 · 5 comments
Labels

Comments

@StephenBloomquist
Copy link
Contributor

StephenBloomquist commented Jan 25, 2017

Is doRemoveBreakpoints accounting for the fact that the duktape breakpoint indices are going to shift after the request is processed? If so, how? I can't quite work it out.

@harold-b
Copy link
Owner

I don't currently recall the inner workings of the code off the top of my head, sorry. I'm preoccupied with a project deliverable at the moment so I can't get into it right now either, so you'll have to dig in 🍚 :)

@StephenBloomquist
Copy link
Contributor Author

StephenBloomquist commented Jan 26, 2017

Yeah I've already looked it into a bit. It doesn't appear to be handling it. From what I can work out getBreakpointsForFile is returning an array of breakpoints with dukIdx in ascending order. They're getting added to the remBPs array in ascending order as well.

If kept this way doRemoveBreakpoints will have to shift all the dukIdx values down every time it calls requestRemoveBreakpoint to keep them in-line with duktape (If you remove index 5, then the breakpoint you have at index 8 would now be at 7, but duktape is being asked to remove at index 8).

I think a better way would be to have the remBPs array sorted such that the dukIdx are in descending order, because then you don't have to care that all the indices above the index you just removed got shifted.

@harold-b
Copy link
Owner

If I recall, the packed index were accounted for. I can't quite recall specifics, so I'll have a look when I get the chance to refactor.

@StephenBloomquist
Copy link
Contributor Author

It is accounted for in removeAllTargetBreakpoints but if it's accounted for in setBreakPointsRequest then I've misread some logic somewhere.

@harold-b
Copy link
Owner

Thanks, I'll also have a look when I get the chance to dive back in 👍

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

No branches or pull requests

2 participants