I’ve been having a tough time entering input with gdb using XCode or Eclipse. Every time the debugger hits std::cin, it looks like its waiting for input, but fails to accept it. I’ve scoured the internet for more information, but am having trouble finding anything.
What do I need to do to get cin to work with gdb? For reference, I’m using XCode 3.2.2 and Eclipse Galileo.
Thanks!
-Carlos Nunez
I guess there is a bug in GCC related to the usage of std::cin and setting/unsetting breakpoints. I did a minimal example:
This code works perfectly until you set or activate a breakpoint (at least using the XCode wrapper). From then on stdin buffer is broken and every getline() retrieves the last input even though you don’t type a key, entering a endless loop.
I don’t know how to work arround it… 🙁