How to tell GDB to flush the stdio of the program being debugged

Posted by Yorkwar on Stack Overflow See other posts from Stack Overflow or by Yorkwar
Published on 2011-11-24T01:32:22Z Indexed on 2011/11/24 1:50 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

The stdio is usually buffered. When I hit a breakpoint and there's a printf before the breakpoint, the printed string may still be in the buffer and I can not see it.

I know I can flush the stdio by adding some flush code in the program. Without doing this, is there any way to tell GDB to flush the stdio of the program being debugged after GDB stops? This way is more friendly when debugging a program.

© Stack Overflow or respective owner

Related posts about debugging

Related posts about gdb