Bug 162848

Summary: Web Inspector: Show return value when stepping out of a function
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: NEW    
Severity: Normal CC: inspector-bugzilla-changes, mark.lam, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[WIP] Return Value when leaving function
joepeck: review-
[WIP] Last Returned Value joepeck: review-

Joseph Pecoraro
Reported 2016-10-01 16:55:51 PDT
Summary: Show return value when stepping out of a function When stepping out of a function, or when stepping through an leaving it (paused at the closing brace) we should show the return value somewhere in the UI. Often it is the result of a computation and it would be useful for the user to see + interact with it.
Attachments
[WIP] Return Value when leaving function (35.28 KB, patch)
2016-10-17 12:03 PDT, Joseph Pecoraro
joepeck: review-
[WIP] Last Returned Value (45.38 KB, patch)
2016-10-17 12:03 PDT, Joseph Pecoraro
joepeck: review-
Radar WebKit Bug Importer
Comment 1 2016-10-01 16:56:03 PDT
Joseph Pecoraro
Comment 2 2016-10-17 12:03:11 PDT
Created attachment 291853 [details] [WIP] Return Value when leaving function This didn't handle stepping out of Constructors, where the op_debug is not immediately before an op_return.
Joseph Pecoraro
Comment 3 2016-10-17 12:03:48 PDT
Created attachment 291854 [details] [WIP] Last Returned Value This adds in Last Return Value whenever you step over / step out of a function call.
Joseph Pecoraro
Comment 4 2016-10-17 12:09:52 PDT
After playing with these I believe they are a little too simplistic. They depend on op_ret which doesn't happen for Native/Host functions, so it ends up missing return values of host functions (e.g. the `undefined` from `console.log(1)`). I think a better approach would be: - When compiling with DebugHooks, replace op_call* with op_debug_call* - Which would be equivalent to: op_debug BeforeCall op_call ... op_debug AfterCall - Currently we have BeforeCall but not AfterCall. - BeforeCall is used as a pause opportunity. - AfterCall is can be used to save the return value for the next pause opportunity. - AfterCall may eventually be useful as a pause opportunity for stepping out. So that is why I put up two patches. I think we still end up taking the original patch for "Return Value when leaving function" because this is right before we are leaving the function. it just needs to address the Constructor edge case and get tests. However to get "Last Returned Value" working everywhere I think we need a better approach like the one above.
Note You need to log in before you can comment on or make changes to this bug.