This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/RFC] new setting against auto-answer? (because "input not from terminal")


Hello,

I often have to investigate issues on Windows, except that I usually
don't work locally on a Windows machine.  So, usually, what I do is
ssh to a Windows machine where we have a cygwin SSH daemon running.

If you have been in that situation, and you use a MinGW debugger,
then you probably know that there are a few issues with the "terminal".
One of the issues that is causing us some trouble is the fact that
GDB automatically assumes the default answer for its y/n queries.
For instance:

    (top-gdb) start
    The program being debugged has been started already.
    Start it from the beginning? (y or n) [answered Y; input not from terminal]
    [...]

I propose a new "set/show interactive-mode (auto|on|off)" command
to allow the user to override what GDB detects. By default, GDB
still probes stdin and determines from there what mode should be
used.  But if the user knows what he's doing, he can force it in
situations where GDB's default behavior is less useful.

    (top-gdb) set interactive-mode on
    (top-gdb) start
    The program being debugged has been started already.
    Start it from the beginning? (y or n) n
    Program not restarted.

Attached is a patch that implements that. The name of the option
can be changed if we find a better one. If others are interested,
then I'll work on producing documentation and a little testcase.

2008-10-24  Joel Brobecker  <brobecker@adacore.com>

        * top.c (interactive_mode_auto, interactive_mode_on)
        (interactive_mode_off, interactive_mode_enum, interactive_mode):
        New static globals.
        (show_interactive_mode): New function.
        (input_from_terminal_p): If interactive_mode is not auto, then
        use that rather than checking the stdin settings.
        (init_main): Add "set/show interactive-mode" command.

Tested on x86-linux, no regression.

Thoughts?
-- 
Joel

Attachment: top.c.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]