I’m trying to see the value of stream (ifstream, but it should work for all kind of streams I guess).
The example code could look like this:
stringstream in("One Two Three Four Five");
while(in)
cout << in;
I was trying to do it in following ways but none of them seems to work:
(gdb) print in
(gdb) call cout << in
(gdb) call in.getline()
… and so on.
Is there any way, to see the value of the stream?
You have to make sure that you have the package with the
libstdc++library compiled with the debugging flags.I have the
libstdc++6-8-dbgpackage installed and now I can view all the stream object data ingdb.