From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130336 invoked by alias); 22 Oct 2018 20:56:55 -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 130326 invoked by uid 89); 22 Oct 2018 20:56:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=UD:p.m, p.m, 2018-10-17, 20181017 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Oct 2018 20:56:53 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80889315008B; Mon, 22 Oct 2018 20:56:52 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA1EA60BEC; Mon, 22 Oct 2018 20:56:51 +0000 (UTC) Subject: Re: [PATCH 3/3] Avoid GDB SIGTTOU on catch exec + set follow-exec-mode new (PR 23368) To: Simon Marchi , gdb-patches@sourceware.org References: <20181016033835.17594-1-simon.marchi@polymtl.ca> <20181016033835.17594-3-simon.marchi@polymtl.ca> <37bde004-853a-3ccc-3777-03cc43b36147@redhat.com> <5375d6a4-8b4d-af3a-2b37-f0b88363d5d3@polymtl.ca> From: Pedro Alves Message-ID: <9e8dd186-86bd-5a6a-16a1-5aab96725a7b@redhat.com> Date: Mon, 22 Oct 2018 20:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5375d6a4-8b4d-af3a-2b37-f0b88363d5d3@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00479.txt.bz2 On 10/20/2018 04:38 PM, Simon Marchi wrote: > On 2018-10-20 11:13 a.m., Simon Marchi wrote: >> On 2018-10-17 1:04 p.m., Pedro Alves wrote: >>> I think the "for both inferiors" part is what's dubious here. >>> >>> The process lives on in the new inferior, but we lost its >>> terminal settings! Seems to me that they should be migrated >>> from the old inferior to the new one. And then the problem >>> sorts itself out, because then the new inferior will have >>> target_terminal_state::is_inferior state. >> >> Yeah that makes sense. This crossed my mind when I look at the issue, >> but for some reason I didn't went that route. But now that you say it, >> it appears obvious that this should be the fix. >> >> I just tried copying the inferior::terminal_state value from the old >> inferior to the new inferior, and it fixes the problem. But >> actually, we should also be transferring all of the struct terminal_info >> associated to the inferior, is that right? > > This would be the updated patch (testing on the buildbot at the moment). Yes. Looks good. I think you could avoid the copying-with-garanteed-deleting by adding a "swap_terminal_info" function that swaps the terminal_info and terminal_state between the inferiors. Thanks, Pedro Alves