bug-ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DDD accepts commands when gdb pane is closed


From: -
Subject: Re: DDD accepts commands when gdb pane is closed
Date: Fri, 17 Nov 2000 01:28:09 -0800 (PST)

Thanks Andreas for that very prompt response - I'll
add that forthwith!

Incidentally, I reported another --tty mode problem a
few weeks ago but have had no feedback yet - is there
a reason why there was a change of this behaviour at
DDD 3.2.91 ? Here's a description of the problem which
includes some additional information:

We are attempting to move from DDD 3.1.6 to the
current beta 3.2.91 and are having a problem with the
--tty option.

We use --tty so that we can send commands from a
home-grown program which is the parent of DDD, but
still have the same DDD GUI (and GDB pane).

Except that now if we invoke DDD 3.2.91 with the --tty
option the DDD GUI does NOT appear. The tip-of-the-day
dialog box appears, and the DDD process is running,
but there is no GUI at all. It seems that this is
because DDD will not display its GUI until it can find
a source file to load into the source pane - I *think*
that it looks for the source file containing main().

In our case we are debugging programs where main() has
been linked in from a library file, so the source code
for main() is not available to DDD. Consequently when
DDD starts up it is unable to find a source file to
display and therefore does not bring-up the GUI.

This behaviour is different to DDD 3.1.6 which would
ALWAYS display the GUI on startup, and in our case it
just leaves the source pane empty.

This change of behaviour causes us considerable
problems because now the GUI does not appear and the
user can't even select a source file to load because
they can't click on the File->OpenSource menu as it is
not there!

Is there a reason why this change of behaviour has
been made, or is it just a bug? I can't find anything
in the release notes about it. From our point of view
it has broken DDD's --tty mode. If there is a good
reason why this has changed, then it would help
enormously if an additional command line option was
created which would force the GUI to ALWAYS appear
irrespective of what other options were present.

Colin Browell

--- Andreas Zeller <andreas.zeller@fmi.uni-passau.de>
wrote:
> Hi!
> 
> Colin <cbyh@yahoo.com> writes:
> 
> > We are running DDD via its tty interface so that
> it
> > can be driven by commands from a parent process.
> When
> > DDD is started up in this way (via the --tty
> option)
> > it by default hides the GDB command pane.
> > 
> > However even though the pane is hidden, you can
> still
> > type commands and they are executed by DDD (even
> > though you can't see what you are typing!)
> > 
> > We think that this is wrong. Whenever the GDB pane
> is
> > closed then all keyboard-based command input
> should be
> > disabled aswell.
> > 
> > This causes us a particular problem because we are
> > sending commands to DDD via its tty interface, but
> if
> > the user accidentally hits the keyboard then the
> > keypresses get interleaved with the tty commands
> and
> > we end up with a complete failure due to
> unrecognised
> > commands!
> 
> The enclosed patch fixes this problem - if the
> debugger console is
> closed, keyboard input in the source window will no
> longer be forwarded.
> 
> Note that you can still invoke commands using menu
> accelerators such
> as function keys.  But at least, these accelerators
> can be turned off
> and modified just by changing the resource settings.
> 
> 
> Index: ddd/editing.C
>
===================================================================
> RCS file: /cvsroot/ddd/ddd/ddd/editing.C,v
> retrieving revision 1.49
> diff -u -r1.49 editing.C
> --- ddd/editing.C     2000/05/26 12:13:30     1.49
> +++ ddd/editing.C     2000/11/16 09:36:37
> @@ -53,6 +53,7 @@
>  #include "regexps.h"
>  #include "status.h"
>  #include "string-fun.h"
> +#include "windows.h"
>  
>  #include <iostream.h>
>  #include <Xm/Xm.h>
> @@ -427,15 +428,39 @@
>      }
>  
>      if (e->type != KeyPress && e->type !=
> KeyRelease)
> -     return;
> +     return;                 // Forward only keyboard events
> +
> +    if (!XtIsRealized(gdb_w))
> +     return;                 // We don't have a console yet
> +
> +    if (!have_command_window())
> +     return;                 // The console is closed
> +
> +    // Rationale: Colin <cbyh@yahoo.com> writes:
> +    // We are running DDD via its tty interface so
> that it
> +    // can be driven by commands from a parent
> process. When
> +    // DDD is started up in this way (via the --tty
> option)
> +    // it by default hides the GDB command pane.
> +    // 
> +    // However even though the pane is hidden, you
> can still
> +    // type commands and they are executed by DDD
> (even
> +    // though you can't see what you are typing!)
> +    // 
> +    // We think that this is wrong. Whenever the
> GDB pane is
> +    // closed then all keyboard-based command input
> should be
> +    // disabled as well.
> +    // 
> +    // This causes us a particular problem because
> we are
> +    // sending commands to DDD via its tty
> interface, but if
> +    // the user accidentally hits the keyboard then
> the
> +    // keypresses get interleaved with the tty
> commands and
> +    // we end up with a complete failure due to
> unrecognised
> +    // commands!
>  
>      static bool running = false;
>  
> -    if (running || !XtIsRealized(gdb_w))
> -    {
> -     // Ignore event
> -     return;
> -    }
> +    if (running)
> +     return;                 // We have already entered this
> procedure
>  
>      running = true;
> 
> -- 
> Andreas Zeller     Universitaet Passau
>                   
http://www.fmi.uni-passau.de/st/staff/zeller/


__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]