hediet / vscode-debug-visualizer

An extension for VS Code that visualizes data during debugging.
https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer
GNU General Public License v3.0
7.93k stars 413 forks source link

Rust Demo unexpected visualization #129

Open obayomy opened 2 years ago

obayomy commented 2 years ago

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

hediet commented 2 years ago

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.

art-den commented 2 years ago

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

dianestephens commented 2 years ago

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.

hediet commented 2 years ago

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.

dianestephens commented 2 years ago

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: @.***>

hediet commented 2 years ago

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

dianestephens commented 2 years ago

[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: @.***>

hediet commented 2 years ago

That didn't work ;)

dianestephens commented 2 years ago

[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: @.***>

hediet commented 2 years ago

I cannot see the screenshot unfortunately.

dianestephens commented 2 years ago

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 commented 2 years ago

[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 commented 2 years ago
image
dianestephens commented 2 years ago

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'.

hediet commented 2 years ago

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.

dianestephens commented 2 years ago

Works for the Rust demo!

image
hediet commented 2 years ago

If you like, please file a PR!

Dblm0 commented 1 year ago

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

williamli0707 commented 9 months ago

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