From patchwork Thu Aug 21 16:34:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 2507 Received: (qmail 28982 invoked by alias); 21 Aug 2014 16:34:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28953 invoked by uid 89); 21 Aug 2014 16:34:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Aug 2014 16:34:50 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7LGYlXk025855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Aug 2014 12:34:48 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7LGYkQv020923; Thu, 21 Aug 2014 12:34:47 -0400 Message-ID: <53F61FA6.5050506@redhat.com> Date: Thu, 21 Aug 2014 17:34:46 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: gdb-patches CC: Doug Evans Subject: [PUSHED] infcmd.c: Remove stale TODO References: <1400878753-24688-1-git-send-email-palves@redhat.com> <538739A2.2050105@redhat.com> <20140701162830.GA25877@host2.jankratochvil.net> <1404291574.3766.35.camel@bordewijk.wildebeest.org> <53B3CDCC.9050502@redhat.com> <53B57911.10304@redhat.com> <53B6B0B8.2050702@redhat.com> <21434.52532.737427.778289@ruffy.mtv.corp.google.com> <53BC0D0B.7040001@redhat.com> <21437.28600.751354.629884@ruffy.mtv.corp.google.com> <53BD7749.5000800@redhat.com> <53D8DF7E.6070506@redhat.com> In-Reply-To: This TODO has been stale for over 2 years. In bd5635a1 (1991), we already see the comment, when we only had a bare attach_command: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * TODO: * Should save/restore the tty state since it might be that the * program to be debugged was started on this tty and it wants * the tty in some state other than what we want. If it's running * on another terminal or without a terminal, then saving and * restoring the tty state is a harmless no-op. * This only needs to be done if we are attaching to a process. */ /* * attach_command -- * takes a program started up outside of gdb and ``attaches'' to it. * This stops it cold in its tracks and allows us to start tracing it. * For this to work, we must be able to send the process a * signal and we must have the same effective uid as the program. */ void attach_command (args, from_tty) char *args; int from_tty; { target_attach (args, from_tty); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Later in b5a3d2aa (1992) target_terminal_init, etc. calls are added to attach_command, and in 7e97eb28 (1992) we see: + /* If we attached to the process, we might or might not be sharing + a terminal. Avoid printing error msg if we are unable to set our + terminal's process group to his process group ID. */ + if (!attach_flag) { + OOPSY ("ioctl TIOCSPGRP"); Clearly the TODO has been stale for a long while. I considered preserving the text elsewhere, but then thought the comments in inflow.c already have all the necessary info. gdb/ChangeLog: * infcmd.c (attach_command): Remove comment. --- gdb/ChangeLog | 4 ++++ gdb/infcmd.c | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fae78e5..bf7f618 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-08-21 Pedro Alves + + * infcmd.c (attach_command): Remove comment. + 2014-08-21 Bin Cheng * aarch64-linux-nat.c (dr_changed_t): Change the type from diff --git a/gdb/infcmd.c b/gdb/infcmd.c index bc42cea..b6aba04 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2365,16 +2365,6 @@ proceed_after_attach (int pid) do_cleanups (old_chain); } -/* - * TODO: - * Should save/restore the tty state since it might be that the - * program to be debugged was started on this tty and it wants - * the tty in some state other than what we want. If it's running - * on another terminal or without a terminal, then saving and - * restoring the tty state is a harmless no-op. - * This only needs to be done if we are attaching to a process. - */ - /* attach_command -- takes a program started up outside of gdb and ``attaches'' to it. This stops it cold in its tracks and allows us to start debugging it.