Two Breakpoints Active in Secondary Pane
I was resuming through breakpoints and saw that two of them were marked as active:
Only one should be active at a time.
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
Hello @Rohanhacker ! Were you still working on this? Anything we can help with?
@darkwing I'll send a pr by this weekend
Here's where the bug is https://github.com/devtools-html/debugger.html/blob/master/src/components/SecondaryPanes/Breakpoints/Breakpoint.js#L97-L102
we likely want to only highlight it IF it is the closest breakpoint. so at the column or the closest to the right of the pause location
@jasonLaster ok, I'll start on this tomorrow and will reach out if I have any questions
@jasonLaster so Should I change it to get the location with column and then highlight it if its close enough ??
@Rohanhacker i think that makes sense
Does anybody have a simple online test page for this?
Honza
I found steps to repeat:
- Go to https://davidwalsh.name
- Pretty-print
main.js - Add breakpoints to lines 2, 7, 9
- Refresh
- Notice: main.js' pretty-printed page tab pauses at line 45. Weird. Also, no sources highlighted with green in the right breakpoints pane
- Click on "main.js", the generated file
- All breakpoints in the right pane are highlighted
/claim
Thanks for claiming the issue! :wave:
!!! Please check your email and confirm the invitation
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
Here's where the bug is https://github.com/devtools-html/debugger.html/blob/master/src/components/SecondaryPanes/Breakpoints/Breakpoint.js#L97-L102
we likely want to only highlight it IF it is the closest breakpoint. so at the column or the closest to the right of the pause location
I'm not sure where they highlight functionality occurs but are you saying that this function (isCurrentlyPausedAtBreakPoint) returns true no matter if the frameId and bpId are different column numbers given the same line number?
@akashs09 The root issue here is the comparison is done without the column, so the logic is sort of "If it's line 1, then highlight it", where there could be 5 breakpoints on line 1 at different column spots; if we make the column part of the comparison, we can better identify the closest breakpoint.
I yolo'd with this a little bit (thus the console.log calls):
https://gist.github.com/darkwing/370807f88b5938d80b1e8204218cc3a3
The big change is using makeLocationId but it's sort of weird in that my steps to reproduce (https://github.com/devtools-html/debugger.html/issues/6734#issuecomment-422563408) still don't match, but if I put breakpoints on the pretty file's lines 30, 31, 32, 33, etc. (that batch of var declarations) they all show the single breakpoint highlighted properly.
@loganfsmyth Do you know of any existing location between original and generated sources when a breakpoint is hit? With my original STR, the columns are shown as 30, 125, and 149 for the original source:

When I refresh and the breakpoints hit, however, the breakpoint's column number is 590:
Any idea what could cause this?
I think we should hold on this until @jasonLaster's column breakpoint stuff is in; this is essentially a location weirdness issue and using Logan's location work would be good.
@loganfsmyth Just pinging you on this since I don't recall getting feedback. I also don't know if your breakpoint specificity stuff would cover the oddness from this comment: https://github.com/devtools-html/debugger.html/issues/6734#issuecomment-428439141
Yeah, sounds like we should re-evaluate once the specificity work is done. We'll probably need to do some work on how we track and sync breakpoints, since server-side they only really have a generated location. We'll probably want to threat the original position as render-only and maybe use it on reload when syncing things to the new file content.
Do you know of any existing location between original and generated sources when a breakpoint is hit?
I'm not totally clear on what you're asking here.