Open Bug 1616211 Opened 5 years ago Updated 2 years ago

Wrong line for captured async frame

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: Honza, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached image image.png

STR:

  1. Load https://relieved-cesium.glitch.me/
  2. Create BP on line 19
  3. Click the Click Me! button on the page, the debugger should pause
  4. Check out the Call stack side panel, the line for frame onTestCaseStart is 4 => BUG

AR: The line for frame onTestCaseStart is 4

ER: The line for the frame should be 9 since that's where the (parent) function call happens.

Honza

Huh, this is an interesting case. I can see the argument for wanting to go with this approach, but it's definitely not what we do right now and I guess it's a question of expectation, and I could really go either way. Right now, the position used is the position where the callback is attached, not where the action that eventually asynchronously triggers the callback was initiated. Line 9 is what started the operation, but line 4 is where the callback was attached to the XHR object.

Attached image image.png

I created yet another test case here: https://changeable-dresser-sgpdrfz01.glitch.me/

It's very similar to the XHR test case except there are no XHR but, plain JS functions

In this case the line for the send function is correctly: 9
(i.e. not the location where the callback is attached)

Perhaps it's related to how XHR is internally implemented..?

In any case, I think that the expectation should be that both test cases work the same.

Honza

I think you're right about .send being a nicer location, but this does seem like it could be a large change, so I'd really have to dig into the infrastructure of captured stacks to potentially change this.

Thank for looking at this Logan!

but this does seem like it could be a large change, so I'd really have to dig into the infrastructure of captured stacks to potentially change this.

Yep, I see. It would be nice to have this fixed but, it isn't a blocker for async captured stacks. So, we shouldn't spend significant time on this at this point (P3 seems appropriate for now)

Honza

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: