Code Monkey home page Code Monkey logo

Comments (16)

dvb99 avatar dvb99 commented on April 28, 2024 6

I faced the same issue but later I came to know about the solution from here. Print setting in gdb

If GDB is printing a large array, it stops printing after it has printed the number of elements set by the set print elements command and appends ... at the end. This limit also applies to the display of strings. When GDB starts, this limit is set to 200. Setting number-of-elements to unlimited or zero means that the number of elements to print is unlimited.

So what you need to do is that while debugging, execute the command -exec set print elements 0 in debug console.

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

Hi there! Thanks for opening an issue.

Basically, it should work like that. But your debugger (cppdbg) is behaving strange.

When evaluating myGraphJson it only prints { ... }. My extension cannot do much with that.
The debugger does not seem to understand strings. My extension cannot help you if even the debugger does not understand strings.
Maybe you can figure out how to teach the debugger about strings.

from vscode-debug-visualizer.

yotamrotelman avatar yotamrotelman commented on April 28, 2024

what debbuger do you recommend to use?
this is my launch file:

image

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

Sorry, I don't have experience in C++. But I know that in order to debug rust properly, you need to install some formatters for gdb. Maybe someone else with more experience can help?

from vscode-debug-visualizer.

yotamrotelman avatar yotamrotelman commented on April 28, 2024

how does the parsing to JSON file works?

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

It pretty much does this:
image

And parses the result. Clearly {...} is not a json. If you make your debugger to output your string in the debug console when evaluating myGraphJson, my extension will work.

from vscode-debug-visualizer.

yotamrotelman avatar yotamrotelman commented on April 28, 2024

The problem is that string is defined as a class in cpp, so to get the data of the string you need to write:
string.data()
but the still there is another problem, because .data() returns an array of char and keeps the \ every time a " is needed in the .json syntax, So the praser can't read the information.

image

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

The escaping is not the problem, the extension already tries to double unescape it. However, the leading address is a problem.

Do you have an idea how to fix this in a generic way?

from vscode-debug-visualizer.

yotamrotelman avatar yotamrotelman commented on April 28, 2024

why the leading address is a problem?

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

image

Is this 0xf...b8 "{ \"kind\": the start of escaped json?
"{ \"kind\": would be!

from vscode-debug-visualizer.

 avatar commented on April 28, 2024

Do you have any solution?

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

I think that command can even be automatically run through a setup command!
Thanks for finding it!

from vscode-debug-visualizer.

zqchinaone avatar zqchinaone commented on April 28, 2024

I faced the same issue but later I came to know about the solution from here. Print setting in gdb

If GDB is printing a large array, it stops printing after it has printed the number of elements set by the set print elements command and appends ... at the end. This limit also applies to the display of strings. When GDB starts, this limit is set to 200. Setting number-of-elements to unlimited or zero means that the number of elements to print is unlimited.

So what you need to do is that while debugging, execute the command -exec set print elements 0 in debug console.

hey. I used this method, but without success
image

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

@zqchinaone can you enter the visualized expr into debug console and post a Screenshot?

from vscode-debug-visualizer.

zqchinaone avatar zqchinaone commented on April 28, 2024

Is it?
image

from vscode-debug-visualizer.

hediet avatar hediet commented on April 28, 2024

It looks like gdb does not recognize the string.

from vscode-debug-visualizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.