-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Error: Vizualising the json of C++ graph view is failing #228
Comments
@hediet Kindly share your views on json parsing by Debug adapter: cppdebug for the above. |
UPDATE: The vizualisation is broken when the json is big. I tried to visualize for small heap it is working fine.
"{\"edges\":[{\"from\":\"0\",\"to\":\"1\"},{\"from\":\"0\",\"to\":\"2\"}],\"kind\":{\"graph\":true},\"nodes\":[{\"id\":\"0\",\"label\":\"10\"},{\"id\":\"1\",\"label\":\"20\"},{\"id\":\"2\",\"label\":\"30\"}]}" Looks like the plugin json parser is failing somehow for bigger json. |
Found a solution for this. from this comment Instead of running this commands everytime manually in the debug console, I created a .gdbinit file with the following and it should be in the following location. %USERPROFILE%\.gdbinit set print elements 0
set print repeats 0 |
Thanks for posting the solution! Because this extension is debugger-independent, it relies on the debugger returning the full string content when requesting an evaluation of a string variable/expression. In this case, the debugger had a limit where it would cut off the string (probably in the middle, which is difficult to spot in the initial screenshot). In other cases, the string is escaped in unexpected ways (there are already some double-escaping heuristics in place). I'm not sure how this can be improved. |
Thanks for making this great plugin. This really makes the debugging interactive and lively. I hope more contributors will jump in to expand the support for the C++ community. @hediet |
I am trying to visualize a graph view of a heap using a cpp std::vector. Following is the code snippet:
res value: //Escaped json given by cpp debugger
"{\"edges\":[{\"from\":\"0\",\"to\":\"1\"},{\"from\":\"0\",\"to\":\"2\"},{\"from\":\"1\",\"to\":\"3\"},{\"from\":\"1\",\"to\":\"4\"},{\"from\":\"2\",\"to\":\"5\"},{\"from\":\"2\",\"to\":\"6\"}],\"kind\":{\"graph\":true},\"nodes\":[{\"id\":\"0\",\"label\":\"10\"},{\"id\":\"1\",\"label\":\"20\"},{\"id\":\"2\",\"label\":\"30\"},{\"id\":\"3\",\"label\":\"40\"},{\"id\":\"4\",\"label\":\"50\"},{\"id\":\"5\",\"label\":\"60\"},{\"id\":\"6\",\"label\":\"70\"}]}"
It is showing the following error:
P.S: I tried to unescape the above json and tested the result in the playground. It is working fine
https://hediet.github.io/visualization/?darkTheme=1
Environment details:
vscode: 1.91.1
cppstd: 20
compiler details:
The text was updated successfully, but these errors were encountered: