This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Question about when stdout is flushed in gdb/mi mode
- From: Gordon Prieur <Gordon dot Prieur at Sun dot COM>
- To: gdb at sourceware dot org
- Date: Tue, 19 Feb 2008 08:32:16 -0800
- Subject: Question about when stdout is flushed in gdb/mi mode
Hi,
If I do several printf command before a breakpoint in normal
command line gdb, the stdout gets flushed prior to showing the stop
message in gdb. If I do the same thing in mi mode from a tty, I get
the same results. But if I do this from NetBeans (where gdb isn't
running in a tty), the output doesn't get flushed and hence doesn't
get shown before the stop.
Looking at the gdb options, I don't see anyway of forcing a
flush of stdout. Since stdout isn't a variable and libc is typically
optimized without debug information, neither "fflush(stdout)" nor
"fflush(&__iob[1])" work. Is there anyway to force gdb to flush
stdout when it stops?
Thanks,
Gordon