vscode-debug-visualizer icon indicating copy to clipboard operation
vscode-debug-visualizer copied to clipboard

Rust Demo unexpected visualization

Open obayomy opened this issue 4 years ago • 19 comments

Hello, when I run the Rust demo the vector displays in a strange way and the grid display doesn't work correctly. Debugger: LLDB

Vector visualization: vector

Grid visualization: grid

obayomy avatar Nov 09 '21 18:11 obayomy

This used to work...

I will have to look into this, but cannot promise when I will find time. The code should be easy to debug though.

hediet avatar Nov 10 '21 09:11 hediet

Same problem for me. Debug Visualizer is not usable for rust now (

art-den avatar Feb 10 '22 15:02 art-den

I have the same issue. It appears the visualizer is working from the character encodings. ie. 123 instead of { I got this from watch on _s. The visualizer graphs lots of 123's and 34's (curly braces and quotation marks) with the other character encodings mixed in.
image image

I can plug the JSON string in _s into the playground and it yields the correct graph but how do we get the visualizer to work from the JSON? This is an awesome tool! Thanks so much.

dianestephens avatar Jun 22 '22 15:06 dianestephens

Can you debug this extension?

I fear this is the culprit:

https://github.com/hediet/vscode-debug-visualizer/blob/2453c8bf9c4a6fb46459737e8165ce5a961167c2/extension/src/VisualizationBackend/GenericVisualizationSupport.ts#L68

But it should be super easy to fix. I just don't have a working rust environment though.

hediet avatar Jun 22 '22 15:06 hediet

I am new to VSCode but figure I will learn a lot looking at this extension. However, I am not able to get the extension working from my local build. Ran yarn and yarn build in the root. F5 to get the development host window. Open my demo project folder. I can debug but in the command palett when I start Debug Visualizer: New View I never get the input to watch. If I select Debug Visualizer: Use Selection as Expression nothing happens.

Suggestions appreciated.

[cid:955868F3-8533-41B4-8804-985D8D34B904]

On Jun 22, 2022, at 11:40 AM, Henning Dieterichs @.@.>> wrote:

Can you debug this extension?

I fear this is the culprit:

https://github.com/hediet/vscode-debug-visualizer/blob/2453c8bf9c4a6fb46459737e8165ce5a961167c2/extension/src/VisualizationBackend/GenericVisualizationSupport.ts#L68

— Reply to this email directly, view it on GitHubhttps://github.com/hediet/vscode-debug-visualizer/issues/129#issuecomment-1163277076, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJ5PUFRPOFDRHUETFCTQTLVQMXV5ANCNFSM5HV7TASQ. You are receiving this because you commented.Message ID: @.***>

dianestephens avatar Jun 24 '22 14:06 dianestephens

Can you show a screenshot of the view? There should be an input field where you can enter the expression.

hediet avatar Jun 27 '22 08:06 hediet

[image001.png]

Sent from my iPad

On Jun 27, 2022, at 4:50 AM, Henning Dieterichs @.***> wrote:



Can you show a screenshot of the view?

Yes. I don’t get the input field. Not when I select New View or Use Selection as Expression. Any help on what I am missing is appreciated. I would like to learn from debugging this extension. Thanks, Diane Stephens

There should be an input field where you can enter the expression.

— Reply to this email directly, view it on GitHubhttps://github.com/hediet/vscode-debug-visualizer/issues/129#issuecomment-1167068234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJ5PUF7ATPF4QHGVACV3CLVRFTNHANCNFSM5HV7TASQ. You are receiving this because you commented.Message ID: @.***>

dianestephens avatar Jun 27 '22 14:06 dianestephens

That didn't work ;)

hediet avatar Jun 27 '22 15:06 hediet

[image0.png] Uhg! This? Sent from my iPad

On Jun 27, 2022, at 1:10 PM, Henning Dieterichs @.***> wrote:



That didn't work ;)

— Reply to this email directly, view it on GitHubhttps://github.com/hediet/vscode-debug-visualizer/issues/129#issuecomment-1167534856, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJ5PUAE3TRFV73DXTXVCLTVRHN7XANCNFSM5HV7TASQ. You are receiving this because you commented.Message ID: @.***>

dianestephens avatar Jun 27 '22 17:06 dianestephens

I cannot see the screenshot unfortunately.

hediet avatar Jun 27 '22 20:06 hediet

Did you see the message from my other email- @.? Anyway, Here’s Another try. [image0.jpeg] Sent from my iPhone [image001.PNG] On Jun 27, 2022, at 4:54 PM, Henning Dieterichs @.> wrote:



I cannot see the screenshot unfortunately.

— Reply to this email directly, view it on GitHubhttps://github.com/hediet/vscode-debug-visualizer/issues/129#issuecomment-1167885096, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJ5PUFQN7GRCSCF3Z4OGY3VRIIH3ANCNFSM5HV7TASQ. You are receiving this because you commented.Message ID: @.***>

dianestephens avatar Jun 27 '22 23:06 dianestephens

[image001.PNG]

Sent from my iPhone

On Jun 27, 2022, at 7:35 PM, diane mljsoftware.com @.***> wrote:

 Did you see the message from my other email- @.? Anyway, Here’s Another try. [image0.jpeg] Sent from my iPhone [image001.PNG] On Jun 27, 2022, at 4:54 PM, Henning Dieterichs @.> wrote:



I cannot see the screenshot unfortunately.

— Reply to this email directly, view it on GitHubhttps://github.com/hediet/vscode-debug-visualizer/issues/129#issuecomment-1167885096, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJ5PUFQN7GRCSCF3Z4OGY3VRIIH3ANCNFSM5HV7TASQ. You are receiving this because you commented.Message ID: @.***>

dianestephens avatar Jun 27 '22 23:06 dianestephens

image

dianestephens avatar Jul 06 '22 22:07 dianestephens

Ran the Rust demo, a vec![1,2,3], with the extension in debug and got a little more information. The issue is where you thought (https://github.com/hediet/vscode-debug-visualizer/blob/2453c8bf9c4a6fb46459737e8165ce5a961167c2/extension/src/VisualizationBackend/GenericVisualizationSupport.ts#L69)

const graph = await this.constructGraphFromVariablesReference(
     reply.result,
     reply.variablesReference
);

reply.result contains the json string for the correct graph with 3 nodes. Here's a SS: image

then constructGraphFromVariablesReference constructs the bfsQueue array but puts the entire graph data at node[0]. bfsQueue has length 1. Here's a screenshot: image So on return you can see the graph data for a 3 node graph is all in node 0 of graph. image I am not sure how Rust is different in this case so not sure what is 'correct'.

dianestephens avatar Jul 26 '22 21:07 dianestephens

Actually, this should be falsy to work for arbitrary json:

https://github.com/hediet/vscode-debug-visualizer/blob/2453c8bf9c4a6fb46459737e8165ce5a961167c2/extension/src/VisualizationBackend/GenericVisualizationSupport.ts#L68

The variables reference was an external contribution and it works nicely in Python.

I suggest to first try parseEvaluationResultFromGenericDebugAdapter and check if it returned an error. Only in case of an error, variablesReference should be checked.

hediet avatar Jul 27 '22 08:07 hediet

Works for the Rust demo! image

dianestephens avatar Jul 27 '22 14:07 dianestephens

If you like, please file a PR!

hediet avatar Jul 27 '22 15:07 hediet

Checked the fix a99d0dd against Rust example. Works nicely. Can we use the changes?

Dblm0 avatar Oct 03 '23 21:10 Dblm0

Seconded, it would be great to use the changes especially since it fixes the java issues as well

williamli0707 avatar Jan 17 '24 02:01 williamli0707