From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101990 invoked by alias); 29 Jul 2015 11:39:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 101938 invoked by uid 89); 29 Jul 2015 11:39:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-oi0-f44.google.com Received: from mail-oi0-f44.google.com (HELO mail-oi0-f44.google.com) (209.85.218.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 29 Jul 2015 11:39:35 +0000 Received: by oihq81 with SMTP id q81so3444867oih.2 for ; Wed, 29 Jul 2015 04:39:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=L4uc9mDnVim1Rs5YJIFxbOdBFwfCADQVkx3Xka3TxcA=; b=bszH3RwQYDa6RvnAhnW0uyBIbd4WgAOOcjjgtgrDWYt92acvGfBRZP9cOgzP7kkudF /FrZRPR2C/94qN5rYbF2SqwwZTxh+4zla68YNOfInpn9yZfu3UGNZwhVmEbRCFZ7Hgkd +Fwz0Rv4L0IjsP/WSS0EwVMMXYlfJCjYVKFkUzyDgwzu73QyhAbu3VIUcFHIvkklgr/+ 8RmQAh0jtmi8bFzNfjbElY7K4czTNQWOY/d1vLbqqKlNQUZZQD5yt6K1WVPd4wX9qqtB EyY5qQgbL1+gNy128mR1uPcmrpXA/ZCdQlCFGO8vUjARDJ98c3eA/3I6EJ67cqtYb1lP y/+Q== X-Gm-Message-State: ALoCoQkC5pdoDUgaTJ9E3JM/u0v4+UcK0cShqWai/hhuuB2AlcrIUGTJdGuO6lN7tMTuK0pTf5lw X-Received: by 10.202.225.65 with SMTP id y62mr37683347oig.78.1438169972807; Wed, 29 Jul 2015 04:39:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.56.202 with HTTP; Wed, 29 Jul 2015 04:39:13 -0700 (PDT) In-Reply-To: <55B81606.6090706@redhat.com> References: <1438053504-21507-1-git-send-email-patrick@parcs.ath.cx> <1438122009-28779-1-git-send-email-patrick@parcs.ath.cx> <55B81606.6090706@redhat.com> From: Patrick Palka Date: Wed, 29 Jul 2015 11:39:00 -0000 Message-ID: Subject: Re: [PATCH] Make sure terminal settings are restored before exiting To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-07/txt/msg00865.txt.bz2 On Tue, Jul 28, 2015 at 7:53 PM, Pedro Alves wrote: > (Small request: I find it helpful when the proposed commit > log is always present in patch resubmissions, making patches > self-contained.) Sure, no problem. > >> diff --git a/gdb/top.c b/gdb/top.c >> index 1e30b1c..6df987a 100644 >> --- a/gdb/top.c >> +++ b/gdb/top.c >> @@ -66,6 +66,7 @@ >> #include "cli-out.h" >> #include "tracepoint.h" >> #include "inf-loop.h" >> +#include "tui/tui.h" >> >> extern void initialize_all_files (void); >> >> @@ -1494,6 +1495,14 @@ quit_force (char *args, int from_tty) >> int exit_code = 0; >> struct qt_args qt; >> >> + /* Make sure that the terminal is left in the state we acquired it. */ >> + target_terminal_ours (); >> +#if defined(TUI) >> + tui_disable (); >> +#endif >> + if (async_command_editing_p) >> + gdb_disable_readline (); >> + > > Can you put these new bits in a separate function, and call it here? > That'll make it easier to reuse, or play with moving the call elsewhere, > if needed. As bonus, if we do the latter, git blame on the function's contents > will still blame you. :-) > > OK with that change. Will do.