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 80510 - *Gdb-lite* Program I/O window
Summary: *Gdb-lite* Program I/O window
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-18 20:23 UTC by Nikolay Molchanov
Modified: 2007-09-06 18:08 UTC (History)
0 users

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 Nikolay Molchanov 2006-07-18 20:23:37 UTC
This is a common IZ for all known problems with "Program I/O" window in "cnd" 
module. Program I/O window is used by inferior program (which is running under 
debugger) for input and output, so IDE has to redirect stdin, stdout and stderr 
to the "Program I/O" window. Debugger gdb allows to redirect stdin, stdout, 
stderr to a tty, using command line option ("--tty /dev/pts/1"), or using 
"-inferior-tty-set" GDB/MI command:

  -inferior-tty-set /dev/pts/1

  Set terminal for future runs of the program being debugged. 

To use this feature we create an external terminal:
              Windows (Cygwin): xterm
              Solaris: gnome-terminal, xterm, dtterm
              Linux: gnome-terminal, xterm
This solution allows to provide full terminal support, so users can debug
any type of interactive programs. But at the same time it requires X11
to be installed on Windows system (X11 is a part of Cygwin installation).
Also it takes some time to start external terminal, so there should be a
progress bar to provide feedback. 

If there is a problem with external terminal, a fall back solution is to use 
a built-in window (input in a textfield). In this case we have a serious
usability issue, because we reuse the same stdin/stdout/stderr to talk with
gdb, and to talk with inferior program, which means:
a) user typed in a command for debugger, but at this moment the inferior
program was running, and got this input
b) user typed in a message for inferior program, but at this moment the
inferior program was stopped, and debugger got this input
c) in general case it is impossible to understand if message came from 
debugger or from inferior program.


Other problems. 

----------------------------------------------------------------------------

Problem 1: Progress bar is not implemented yet. The process of creation of
external terminal is a part of "Start Debugging" process, so it makes sense
to use the same progress bar (which is also not implemented yet).

----------------------------------------------------------------------------

Problem 2: User should be able to specify external terminal (select one from
the list). This should be a property of project (Debugging). Also there should 
be ability to set font, colors, size, title.

----------------------------------------------------------------------------

Problem 3: Ctrl-C should send SIGINT to inferior program (now it closes
external terminal, and does not send signal).

----------------------------------------------------------------------------

Problem 4: Script "loop.sh" is created "on fly" in /tmp directory, and saves 
the results in "/tmp/loop.sh.log" file. These names are not unique, so there
could be a race condition conflict between two debugging sessions.

----------------------------------------------------------------------------

Problem 5: On Windows we have to start X11 system every time we start 
debugging (if X11 is not running, xterm will not work).  

----------------------------------------------------------------------------
Comment 1 Nikolay Molchanov 2006-07-25 18:59:14 UTC
There is one more problem (it was reported by Gordon Prieur):
 External terminal (/bin/gnome-terminal) does not start in his environment
on Solaris system. There is an error message from "stty" in log file, but
it is not clear what caused this message.
Comment 2 Nikolay Molchanov 2006-08-03 23:15:59 UTC
Priority is downgraded from P1 to P3 because:
Problem 4 is fixed (temporary files have unique names).
Problem 5 is fixed (see http://www.netbeans.org/issues/show_bug.cgi?id=81533 for
details).
Problem 6 is eliminated (removed support for gnome-terminal on Solaris).

Problem 1 still exists, but it is not very serious, because the performance
seems to be good enough (it takes about 1-2 seconds to start debugging). 
Problem 2 is patially fixed (environment variable XTERM can be used), but we
need a better design dcision here.
Comment 3 _ gordonp 2007-08-22 16:31:29 UTC
Fixed in release 551u1 and later.