Printing large std::vector onto a file during VSCode debug session

  Kiến thức lập trình

I am on a breakpoint in my C++ code in VSCode debugging session. Is there a way to print the contents of a large std::vector (size 3600) onto a file while on a breakpoint?

I tried using gdb commands through the Debug Console, but it only prints the first couple of elements.
enter image description here

I set logging enabled to write gdb output to a file hoping the log would contain all vector elements, but the log had the exact output as the terminal (it cuts off at 64).

Is there any way I can write all vector elements onto a file for inspection? I doesn’t have to be a gdb solution.

LEAVE A COMMENT