Reputation: 838
If I use the command run inside gdb to rerun my program I can no longer pretty print my c++ objects like vectors:
$ gdb ./some_program
(gdb) br some_where
(gdb) run
(gdb) print some_vector # the vector is pretty printed
(gdb) run
(gdb) print some_vector # the vector is no longer pretty printed
Here's a sample code I used and its actual gdb session:
#include <vector>
#include <iostream> using namespace std;
int main()
{
vector<int> v{1};
cout << v[0] << endl;
}
Upvotes: 1
Views: 142
Reputation: 35845
This is most likely this libstdc++ pretty printers bug.
You can apply this patch to you currently installed pretty printers or update whole gcc to a more recent version.
Upvotes: 1