When inspecting values in the debugger, long strings are truncated, which, for example, makes it impossible to see the rest of this exception message here:

The value is also truncated if I right-click the message on the "variables" window and click "Copy Value". The value also gets truncated in the debug console, if I try printing it there. I don't think there's currently any way to view this string without it getting truncated.
I have the latest stable of VS Code (1.21.1) and vscode-cpptools (0.16.1) installed.
Right now I'm working around this by modifying the code to print the message to std::cout before throwing, but that's obviously not ideal..
@aleksijuvani I assume you are using gdb. This looks like the default setting for gdb which is 200 characters. You can add a command to increase it to unlimited by using set print elements <size> where size is the number of elements and 0 being unlimited.
So in your launch.json, add the following block to the "setupCommands": array:
{
"text": "-interpreter-exec console \"set print elements 0\"",
"ignoreFailures": true
}
to make it unlimited.
@pieandcakes Sorry, I forgot to mention this. I'm using the cppvsdbg debugger.
Was there ever a solution to this issue? Seems like the answer above is for gdb and not cppvsdbg. The truncation is a real issue when trying to copy long strings or byte arrays in the local variables list
@pieandcakes Is there any solution? LLDB also meets this problem, this is unacceptable
@JemmyWong Any solution for truncation in cppvsdbg will be in the debugger itself and will not apply to lldb. You can try the solution for gdb for lldb
Hello @pieandcakes : Is there any update about this issue ? I've also been using CPPVSDBG for a while and still can't copy large string values. Since I'm not using GDB, I couldn't figure out any kind of parameter that would allow to extend that characters limit.
This is really annoying, since copying and analyzing data from the variables tab is one of the major features for a real-time debugger. Thanks in advance for your response !
@JoffreyAlto I haven't had time to investigate yet, but it is on my list.
Most helpful comment
@aleksijuvani I assume you are using
gdb. This looks like the default setting forgdbwhich is 200 characters. You can add a command to increase it to unlimited by usingset print elements <size>wheresizeis the number of elements and0beingunlimited.So in your
launch.json, add the following block to the"setupCommands":array:to make it unlimited.