This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 129586 - stdout is not flushed before breakpoints in console output
Summary: stdout is not flushed before breakpoints in console output
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-08 01:24 UTC by _ gordonp
Modified: 2009-11-02 11:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gordonp 2008-03-08 01:24:50 UTC
This is a follow-up to 120647 (No console output in the Output Window). I'm closing that bug
because output does display to the terminal. The remaining problem is really a different problem.

The problem is that printing to stdout before a breakpoint doesn't guarantee it will be flushed
and visible. The root cause of this is that libc doesn't flush stdout unless its outputting to
a tty. Since the output window is not a tty, no flush. This is inherent in all Un*x and there is
no direct way to change this.

The solution taken in this issue is to create a shared library (one per supported platform) which
gets loaded at debugger startup and tells stdio to line buffer stdout. The shared libraries are
prebuilt and installed into the cnd2/bin directory with source and Makefile in cnd2/src/GdbHelper.
Comment 1 _ gordonp 2008-03-08 01:27:10 UTC
The shared library is prebuilt and correctly loaded on Solaris 10 (both sparc and x86), MacOSX (Leopard),
Windows XP SP2, and Linux (Ubuntu 7.10). It works correctly on all of these platforms with the exception
of Windows XP. It appears to be a Cygwin problem on Windows and a Cygwin bug will be filed.
Comment 2 _ gordonp 2008-03-08 01:57:41 UTC
Fixed for all platforms except Windows in http://hg.netbeans.org/main?cmd=changeset;node=2cd0397d3b30.

I'll file a Cygwin bug Monday and take a quick look at debugging the cygwin.dll to
see if I can supply a fix to Cygwin.org.

Downgrading to P3 because there is nothing further I can do in either netbeans or
gdb. Any further improvement must come from cygwin.dll.
Comment 3 _ gordonp 2008-03-08 01:59:00 UTC
Changing target from 6.1 to future as there is nothing further I can do.
Comment 4 _ gordonp 2008-11-17 18:26:10 UTC
Fix depends on Cygwin fix...
Comment 5 Quality Engineering 2009-11-02 11:16:59 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX