It works ... but I found odd thing: sometimes gdb crashed on start. Looks like it try to prepare non-initialized local variables in main for pretty-printing. At least switch off corresponding option in Setting results in stable (and really fast) further operation.
Did you mean like below:
int main()
{
int a;// set breakpoint here
vector<string> b;
}
Then, you try to use pretty printer to show the variable b?
surely, b is non-initialized local variable, and this will let gdb/python script go to some un-expected behavior, like go infinite loop to show its member.
This is a known bug, I have discussed this bug in this forum before. I also have a workaround patch on GDB to compare the line number between the current PC address and the variable line, then try to filter out the non-initialized local variable. But I do not think this patch will be much reliable.