Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Balazs Kezes <rlblaster@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Dummy first call to gdb_has_a_terminal()
Date: Wed, 28 Jul 2010 21:21:00 -0000	[thread overview]
Message-ID: <AANLkTi=WSMT+91Fqkdq=uDsY+U5u=K__WObdEi44CARP@mail.gmail.com> (raw)
In-Reply-To: <AANLkTik3Yp6h5VcW-9j9kfJzQH4Tyqz8zhg8qm=2SGKJ@mail.gmail.com>

Okay, now I checked this more thoroughly. initalize_all_files() in init.c
calls tui initialization functions which mess up the terminal and call
gdb_has_a_terminal() afterwards. So it must be called before this function.

The other way (start gdbtui /bin/echo, switch to gdb, run) seems to work
after the gdb_has_a_terminal is added to the initialize_stdin_serial().

So here is my revised patch:

Changelog:
       * inflow.c (initialize_stdin_serial): Added gdb_has_a_terminal to
       actually save all the tty settings.
       * top.c (gdb_init): Move initialize_stdin_serial before
       initialize_all_files because it assumes it has been already called.


Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.59
diff -c -p -r1.59 inflow.c
*** inflow.c	14 May 2010 21:25:51 -0000	1.59
--- inflow.c	28 Jul 2010 21:09:15 -0000
*************** void
*** 843,848 ****
--- 843,849 ----
  initialize_stdin_serial (void)
  {
    stdin_serial = serial_fdopen (0);
+   (void) gdb_has_a_terminal ();
  }

  void
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.181.2.1
diff -c -p -r1.181.2.1 top.c
*** top.c	27 Jul 2010 19:13:11 -0000	1.181.2.1
--- top.c	28 Jul 2010 21:09:15 -0000
*************** gdb_init (char *argv0)
*** 1613,1618 ****
--- 1613,1619 ----
    init_cmd_lists ();		/* This needs to be done first */
    initialize_targets ();	/* Setup target_terminal macros for utils.c */
    initialize_utils ();		/* Make errors and warnings possible */
+   initialize_stdin_serial ();	/* Make sure interpreters can init properly */
    initialize_all_files ();
    /* This creates the current_program_space.  Do this after all the
       _initialize_foo routines have had a chance to install their
*************** gdb_init (char *argv0)
*** 1625,1632 ****
    init_cli_cmds();
    init_main ();			/* But that omits this file!  Do it now */

-   initialize_stdin_serial ();
-
    async_init_signals ();

    /* We need a default language for parsing expressions, so simple things like
--- 1626,1631 ----

--
Balazs


      reply	other threads:[~2010-07-28 21:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18  0:30 Balazs Kezes
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 [this message]

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='AANLkTi=WSMT+91Fqkdq=uDsY+U5u=K__WObdEi44CARP@mail.gmail.com' \
    --to=rlblaster@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /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