The enclosed patch fixes 16196, which was revealed when an unitialized C++ string happened to point to valid memory and had a garbage in the size field that happened to look very large. GDB then spins a very long time reading invalid memory. The patch fixes this by enforcing the fetch limit (which, in turn, is set by print elements) even when the size of the string is known. This makes the function's behavior similar to when the size of the string isn't know. I checked all callers, and it this does not cause any difference in behavior, and reveals no new problems in the test-suite. Thanks Sterling 2013-11-22 Sterling Augustine PR backtrace/16196: * valprint.c (read_string): Set new variable fetchlen based on fetchlimit and size. Use it in call to partial_memory_read. Update comment.