From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63671 invoked by alias); 27 Jul 2015 19:12:56 -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 63659 invoked by uid 89); 27 Jul 2015 19:12:55 -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-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 27 Jul 2015 19:12:55 +0000 Received: by obre1 with SMTP id e1so67187087obr.1 for ; Mon, 27 Jul 2015 12:12:53 -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=U8kzqIPza7sGjuLJWFweo6Zlu/qdNw4MbBFic1ifPX0=; b=f2B++SaRKYrndPmXRoWBzshk7vvmSJFItMmanp/ooWAC44FlnB/n+Ia2BRqikBxbXq j7VGkntf5DEBnUvYVv8bmKmBzDA8bgCBzj/OIh1qMDJDg0914BQKDynF+IJgJ6lo0MIM YYp07w3dwhlBYkRM00fG+n2KhC4jFxpok011RhQ6/pOYSF6FIxoF5ddxcfb+HOsb0GqH trpLtrYIuHIRirXJgjHs/gWoBrFHfgUEWub61nK07wnjjmi45+Dp8jm8JqqVwZKbh8J2 D/iOGvFsrHh/OiGbej7a6UK/NJw5sgdPa0yPsVNsho09qfe01TNdJXduEfnDDrGYLKhb N4zg== X-Gm-Message-State: ALoCoQnaOOcn3YWqxTFoHWqHMAXBZGAnJHhs9y1UptiPwIQsZ4DYVWdwT6ottvTTPCtDAOjfb7Aq X-Received: by 10.60.56.35 with SMTP id x3mr30695678oep.65.1438024373239; Mon, 27 Jul 2015 12:12:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.56.202 with HTTP; Mon, 27 Jul 2015 12:12:33 -0700 (PDT) In-Reply-To: References: <1438013299-1449-1-git-send-email-patrick@parcs.ath.cx> <55B65EAE.5090000@redhat.com> From: Patrick Palka Date: Mon, 27 Jul 2015 19:12:00 -0000 Message-ID: Subject: Re: [PATCH] Call target_terminal_ours in quit_force To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-07/txt/msg00805.txt.bz2 On Mon, Jul 27, 2015 at 2:49 PM, Patrick Palka wrote: > On Mon, Jul 27, 2015 at 12:39 PM, Pedro Alves wrote: >> On 07/27/2015 05:11 PM, Patrick Palka wrote: >>> On Mon, Jul 27, 2015 at 12:08 PM, Patrick Palka wrote: >>>> We should make sure our terminal settings are in effect before finally >>>> quitting GDB. Our terminal settings may not be in effect at this point >>>> if we are e.g. quitting due to a SIGTERM. >>> >>> I should add, "quitting due to a SIGTERM while an inferior an inferior >>> is running in the foreground." >> >> Looks OK, though I notice that the settings are broken even if we >> we're not debugging anything: >> >> $ stty >> speed 38400 baud; line = 0; >> iutf8 >> >> $ ./gdb >> GNU gdb (GDB) 7.10.50.20150726-cvs >> (gdb) >> *sent SIGTERM from another terminal, gdb exits* >> $ >> $ stty (echo is off) >> speed 38400 baud; line = 0; >> lnext = ; min = 1; time = 0; >> -icrnl iutf8 >> -icanon -echo >> $ >> >> Do you also see this? > > Yeah, even with this patch... > > $ stty > speed 38400 baud; line = 0; > -brkint -imaxbel iutf8 > $ gdb -q > (gdb) *SIGTERM* > $ stty > speed 38400 baud; line = 0; > lnext = ; > -brkint -icrnl -imaxbel iutf8 > > Quitting via the "quit" command is OK though... strange. This happens because when quitting via SIGTERM a readline callback handler remains installed which means that the terminal is still prepped by readline. The readline callback handler is temporarily removed during the execution of a command (thus deprepping the terminal) which is why quitting via "quit" does not leak our terminal settings.