debugger icon indicating copy to clipboard operation
debugger copied to clipboard

Two Breakpoints Active in Secondary Pane

Open darkwing opened this issue 8 years ago • 18 comments

I was resuming through breakpoints and saw that two of them were marked as active:

probs

Only one should be active at a time.

darkwing avatar Jul 31 '18 21:07 darkwing

/claim

Rohanhacker avatar Aug 09 '18 06:08 Rohanhacker

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!

claim avatar Aug 09 '18 06:08 claim

Hello @Rohanhacker ! Were you still working on this? Anything we can help with?

darkwing avatar Aug 21 '18 14:08 darkwing

@darkwing I'll send a pr by this weekend

Rohanhacker avatar Aug 21 '18 14:08 Rohanhacker

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 avatar Aug 21 '18 15:08 jasonLaster

@jasonLaster ok, I'll start on this tomorrow and will reach out if I have any questions

Rohanhacker avatar Aug 21 '18 16:08 Rohanhacker

@jasonLaster so Should I change it to get the location with column and then highlight it if its close enough ??

Rohanhacker avatar Aug 23 '18 06:08 Rohanhacker

@Rohanhacker i think that makes sense

jasonLaster avatar Aug 23 '18 15:08 jasonLaster

Does anybody have a simple online test page for this?

Honza

janodvarko avatar Aug 30 '18 14:08 janodvarko

I found steps to repeat:

  1. Go to https://davidwalsh.name
  2. Pretty-print main.js
  3. Add breakpoints to lines 2, 7, 9
  4. Refresh
  5. Notice: main.js' pretty-printed page tab pauses at line 45. Weird. Also, no sources highlighted with green in the right breakpoints pane
  6. Click on "main.js", the generated file
  7. All breakpoints in the right pane are highlighted

darkwing avatar Sep 18 '18 21:09 darkwing

/claim

akashs09 avatar Sep 26 '18 21:09 akashs09

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!

claim avatar Sep 26 '18 21:09 claim

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 avatar Oct 02 '18 12:10 akashs09

@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.

darkwing avatar Oct 02 '18 15:10 darkwing

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:

whensettingbps

When I refresh and the breakpoints hit, however, the breakpoint's column number is 590:

590

Any idea what could cause this?

darkwing avatar Oct 10 '18 05:10 darkwing

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.

darkwing avatar Jan 16 '19 16:01 darkwing

@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

darkwing avatar Jan 29 '19 22:01 darkwing

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.

loganfsmyth avatar Feb 04 '19 21:02 loganfsmyth