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

Rust Demo unexpected visualization #129

Open
obayomy opened this issue Nov 9, 2021 · 19 comments
Open

Rust Demo unexpected visualization #129

obayomy opened this issue Nov 9, 2021 · 19 comments
Labels
bug Something isn't working
Projects

Comments

@obayomy
Copy link

obayomy commented Nov 9, 2021

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 hediet added this to Triage in Backlog Nov 9, 2021
@hediet
Copy link
Owner

hediet commented Nov 10, 2021

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
Copy link

art-den commented Feb 10, 2022

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

@hediet hediet added the bug Something isn't working label Feb 10, 2022
@dianestephens
Copy link

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
Copy link
Owner

hediet commented Jun 22, 2022

Can you debug this extension?

I fear this is the culprit:

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

@dianestephens
Copy link

dianestephens commented Jun 24, 2022 via email

@hediet
Copy link
Owner

hediet commented Jun 27, 2022

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

@dianestephens
Copy link

dianestephens commented Jun 27, 2022 via email

@hediet
Copy link
Owner

hediet commented Jun 27, 2022

That didn't work ;)

@dianestephens
Copy link

dianestephens commented Jun 27, 2022 via email

@hediet
Copy link
Owner

hediet commented Jun 27, 2022

I cannot see the screenshot unfortunately.

@dianestephens
Copy link

dianestephens commented Jun 27, 2022 via email

@dianestephens
Copy link

dianestephens commented Jun 27, 2022 via email

@dianestephens
Copy link

image

@dianestephens
Copy link

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 (

const graph = await this.constructGraphFromVariablesReference(
)

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
Copy link
Owner

hediet commented Jul 27, 2022

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

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
Copy link

Works for the Rust demo!
image

@hediet
Copy link
Owner

hediet commented Jul 27, 2022

If you like, please file a PR!

dianestephens added a commit to dianestephens/vscode-debug-visualizer that referenced this issue Jul 27, 2022
@Dblm0
Copy link

Dblm0 commented Oct 3, 2023

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

@williamli0707
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Backlog
Triage
Development

No branches or pull requests

6 participants