From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22376 invoked by alias); 19 Feb 2008 16:32:48 -0000 Received: (qmail 22365 invoked by uid 22791); 19 Feb 2008 16:32:46 -0000 X-Spam-Check-By: sourceware.org Received: from sca-es-mail-1.Sun.COM (HELO sca-es-mail-1.sun.com) (192.18.43.132) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Feb 2008 16:32:25 +0000 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m1JGWNAF007138 for ; Tue, 19 Feb 2008 08:32:23 -0800 (PST) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JWH00101UY34700@fe-sfbay-10.sun.com> (original mail from Gordon.Prieur@Sun.COM) for gdb@sourceware.org; Tue, 19 Feb 2008 08:32:23 -0800 (PST) Received: from [129.146.82.55] by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JWH005P7V9WVUA0@fe-sfbay-10.sun.com> for gdb@sourceware.org; Tue, 19 Feb 2008 08:32:21 -0800 (PST) Date: Tue, 19 Feb 2008 16:39:00 -0000 From: Gordon Prieur Subject: Question about when stdout is flushed in gdb/mi mode To: gdb@sourceware.org Message-id: <47BB0490.6070703@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5 (X11/20060113) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00129.txt.bz2 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