Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"smartStep" skipped frames are not grayed out #65025

Closed
roblourens opened this issue Dec 13, 2018 · 14 comments
Closed

"smartStep" skipped frames are not grayed out #65025

roblourens opened this issue Dec 13, 2018 · 14 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded

Comments

@roblourens
Copy link
Member

I'm seeing that frames skipped by smartStep are not grayed out, but frames from skipFiles are. This is in 1.30. The DA is sending the right thing and you can see this info in the tooltip.

screen shot 2018-12-13 at 11 58 40 am 2

Here's an example of DA output (not from the screenshot)

			"id": 1065,
			"name": "(anonymous function)",
			"source": {
				"name": "nodeDebugAdapter.js",
				"path": "/Users/roblou/code/vscode-node-debug2/out/src/nodeDebugAdapter.js",
				"origin": "(skipped by 'smartStep')",
				"presentationHint": "deemphasize"
			},
			"line": 10,
			"column": 71
		}, {
			"id": 1066,
			"name": "__awaiter",
			"source": {
				"name": "nodeDebugAdapter.js",
				"path": "/Users/roblou/code/vscode-node-debug2/out/src/nodeDebugAdapter.js",
				"origin": "(skipped by 'smartStep')",
				"presentationHint": "deemphasize"
			},
			"line": 6,
			"column": 12
		}, {
			"id": 1067,
			"name": "terminateSession",
			"source": {
				"name": "nodeDebugAdapter.js",
				"path": "/Users/roblou/code/vscode-node-debug2/out/src/nodeDebugAdapter.js"
			},
			"line": 492,
			"column": 16
		}, {
			"id": 1068,
			"name": "chrome.Runtime.on.params",
			"source": {
				"name": "nodeDebugAdapter.ts",
				"path": "/Users/roblou/code/vscode-node-debug2/src/nodeDebugAdapter.ts"
			},
			"line": 308,
			"column": 22
		}, {
			"id": 1069,
			"name": "emitOne",
			"source": {
				"name": "events.js",
				"path": "<node_internals>/events.js",
				"sourceReference": 1001,
				"origin": "read-only core module (skipped by 'skipFiles')",
				"presentationHint": "deemphasize"
			},
			"line": 116,
			"column": 13
		}, {
			"id": 1070,
			"name": "emit",
			"source": {
				"name": "events.js",
				"path": "<node_internals>/events.js",
				"sourceReference": 1001,
				"origin": "read-only core module (skipped by 'skipFiles')",
				"presentationHint": "deemphasize"
			},
			"line": 211,
			"column": 7
		}, {
@isidorn isidorn added this to the January 2019 milestone Dec 14, 2018
@isidorn
Copy link
Contributor

isidorn commented Dec 27, 2018

Looking at the code I see no difference in handling these. Since all of them have a "presentationHint": "deemphasize", so they are equel to the vscode frontend.

Can you please provide a reproducable sample so I can investigate further on my machine?
An alternative is that you just put a brekapoint here and check why the disabled class does not get toggled.

@isidorn isidorn added info-needed Issue requires more information from poster debug Debug viewlet, configurations, breakpoints, adapter issues labels Dec 27, 2018
@roblourens
Copy link
Member Author

Problem seems to come from here:

image

source.presentationHint is not read

@isidorn
Copy link
Contributor

isidorn commented Dec 27, 2018

Good catch, however I think that is fine.
Please note that we have the presentationHint both on the stackFrame and on the Source which is somehwat confusing.
In this particular case the source object contains the appropriate presentationHint and that is passed inside the stack frame properly. When we are rendering the stackFrame at a code pointer I gave above, we are acutally checking the presentationHint of the Source object inside. And that one should be correct in this case, right?

@roblourens
Copy link
Member Author

At that line in callStackView.ts, stackFrame.source.presentationHint is undefined. So it seems to be correct when the object is created but becomes wrong at some point between that and being rendered.

@isidorn
Copy link
Contributor

isidorn commented Jan 4, 2019

@roblourens can you provide some reproducable steps so I try to investigte more?
Thanks

@roblourens
Copy link
Member Author

I see this for all smartStep frames

@isidorn
Copy link
Contributor

isidorn commented Jan 11, 2019

@roblourens cool. But do you have an example for which I can easily get into this situation? Asking becuase I do not and I would prefer you give me an example than me setting this up.
Thanks

@roblourens
Copy link
Member Author

Sure, clone this: https://github.com/roblourens/repro65025

Set BPs on lines 6, 11, and 16.

No decoration on the unmapped .js frames when at lines 6 and 11:

image

But they are decorated correctly at 16:
image

And in both cases, the DA is returning basically the same thing,

"origin": "(skipped by 'smartStep')",
"presentationHint": "deemphasize"

for all the relevant files.

@isidorn isidorn removed the info-needed Issue requires more information from poster label Jan 14, 2019
@isidorn
Copy link
Contributor

isidorn commented Jan 23, 2019

@roblourens thanks for this great steps. I can nicely repro.
After investigation the issue is here

So this issue sort of contradicts with #42139

The problem is that we currently do not allow multiple source objects for the same resource. Only one.

As a workaround I suggest that you put the presentation hint of deemphasize on the stack frame when it happens that some parts of the call stack you want to deemphasize and some not - while all of them living in the same file.

Would that work for you?
If not I am open for suggestions on how to fix this

@isidorn isidorn removed this from the December/January 2019 milestone Jan 23, 2019
@isidorn isidorn added the under-discussion Issue is under discussion for relevance, priority, approach label Jan 23, 2019
@roblourens
Copy link
Member Author

when it happens that some parts of the call stack you want to deemphasize and some not - while all of them living in the same file.

Is that happening here? I think only the .js is deempasized and the .ts is not.

@isidorn
Copy link
Contributor

isidorn commented Jan 24, 2019

Yes. test.js is comming in 3 times, and only the 1 & 2 have presentationHint.

asyncFn1 does not have presentationHint set
screenshot 2019-01-24 at 11 53 03

screenshot 2019-01-24 at 11 51 11

Similar situation is for the second breakpoint.

@roblourens
Copy link
Member Author

Ohhh... that is wrong, this actually exposed that my calculations for the stack frame labels are off by one line in the adapter.

@roblourens
Copy link
Member Author

I don't think there's a valid scenario for these DAs where some parts of a file will be skipped and some parts won't.

But to be safe, should I always just set presentationHint on the frame instead of the source?

@isidorn
Copy link
Contributor

isidorn commented Jan 25, 2019

For now I would leave it on the source since we actually do not specify in the protocol that a presentationHint on the stack frame can be deemphesized. We might need to change that.

https://github.com/Microsoft/vscode/blob/fd9fbbfd507d7db9eafd86fc746b574e1b86d790/src/vs/workbench/parts/debug/common/debugProtocol.d.ts#L1340

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jan 25, 2019
@isidorn isidorn added this to the December/January 2019 milestone Jan 25, 2019
@chrmarti chrmarti added the verified Verification succeeded label Feb 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants