WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
162848
Web Inspector: Show return value when stepping out of a function
https://bugs.webkit.org/show_bug.cgi?id=162848
Summary
Web Inspector: Show return value when stepping out of a function
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-
Details
Formatted Diff
Diff
[WIP] Last Returned Value
(45.38 KB, patch)
2016-10-17 12:03 PDT
,
Joseph Pecoraro
joepeck
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-10-01 16:56:03 PDT
<
rdar://problem/28579565
>
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.
Top of Page
Format For Printing
XML
Clone This Bug