From: Balazs Kezes <rlblaster@gmail.com>
To: gdb-patches@sourceware.org
Subject: [patch] Dummy first call to gdb_has_a_terminal()
Date: Sun, 18 Jul 2010 00:30:00 -0000 [thread overview]
Message-ID: <AANLkTinEb3CWYUe1KlZwICXe4hMY2adiD575Xd4vw_uf@mail.gmail.com> (raw)
Hi,
I've noticed a weird behaviour with TUI at home and at work. It appears when I
switch to the other mode (to command line from gdbtui or to tui from gdb). It
does fix itself when I manage to switch back, but sometimes after executing a
command it messes up readline so I can't switch back easily.
For example:
gdbtui /bin/echo
^x^a
run
The input is messed up now on my computer.
I think bug gdb/9294 is exactly this.
I've tracked it down to gdb_has_a_terminal(). Deep in tui_enable() this
function this called. At this time the terminal has a messed up state (for
example echo is disabled) which is fine. But it turns out this is the first
call to this function and therefore it saves the current terminal settings
which will be used to restore the terminal before displaying the prompt after
executing a command. Even though it works for the current mode, it doesn't
for the other. A neutral mode (the state when gdb starts up) seems to work for
both modes.
The fix is to have a dummy first call somewhere where the terminal is still in
sane state.
Cheers,
Balazs
Index: tui-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-interp.c,v
retrieving revision 1.27
diff -c -p -r1.27 tui-interp.c
*** tui-interp.c 17 May 2010 22:21:43 -0000 1.27
--- tui-interp.c 18 Jul 2010 00:29:25 -0000
*************** _initialize_tui_interp (void)
*** 224,229 ****
--- 224,232 ----
tui_command_loop,
};
+ /* Dummy first call to save sane terminal settings. */
+ (void) gdb_has_a_terminal ();
+
/* Create a default uiout builder for the TUI. */
tui_out = tui_out_new (gdb_stdout);
interp_add (interp_new (INTERP_TUI, NULL, tui_out, &procs));
next reply other threads:[~2010-07-18 0:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-18 0:30 Balazs Kezes [this message]
2010-07-18 9:12 ` Balazs Kezes
2010-07-20 14:52 ` Pedro Alves
2010-07-28 7:23 ` Balazs Kezes
2010-07-28 7:28 ` Balazs Kezes
2010-07-28 21:21 ` Balazs Kezes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinEb3CWYUe1KlZwICXe4hMY2adiD575Xd4vw_uf@mail.gmail.com \
--to=rlblaster@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox