From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9064 invoked by alias); 31 Mar 2017 21:20:52 -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 8712 invoked by uid 89); 31 Mar 2017 21:20:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Fri, 31 Mar 2017 21:20:49 +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 1220A36208C for ; Fri, 31 Mar 2017 21:20:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1220A36208C Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1220A36208C Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D35EC7EBCE; Fri, 31 Mar 2017 21:20:49 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH v5 1/5] Move parts of inferior job control to common/ References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <20170330014915.4894-1-sergiodj@redhat.com> <20170330014915.4894-2-sergiodj@redhat.com> <68a31f8b-d315-0ae7-6d2b-6811bce05766@redhat.com> <87a881tksh.fsf@redhat.com> Date: Fri, 31 Mar 2017 21:20:00 -0000 In-Reply-To: (Pedro Alves's message of "Fri, 31 Mar 2017 19:21:28 +0100") Message-ID: <87bmshrvm6.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00558.txt.bz2 On Friday, March 31 2017, Pedro Alves wrote: > On 03/31/2017 06:31 PM, Sergio Durigan Junior wrote: >> On Friday, March 31 2017, Pedro Alves wrote: >> >>> On 03/30/2017 02:49 AM, Sergio Durigan Junior wrote: >>>> gdb/gdbserver/ChangeLog: >>>> yyyy-mm-dd Sergio Durigan Junior >>>> >>>> * Makefile.in (SFILE): Add "common/job-control.c". >>>> (OBS): Add "job-control.o". >>>> * terminal.h: Include "common-terminal.h". >>> >>> Is there a reason the .h and the .c files are named differently? >> >> Hm, it's just because gdb_setpgid was defined on gdb/terminal.h, so I >> thought it was better to move it to common-terminal.h (i.e., keep the >> naming). Do you want a common/job-control.h? > > So that .h file contains both definitions of symbols that > are the exported API of job-control.c, and also the whole > termios.h/termio.h #ifdefery mess. > > It doesn't look like the termios.h stuff is needed by > the _clients_ of the functions defined in job-control.c? > > So I think the best is to have two headers instead. > > One with the termios.h/termio.h #ifdef-ery stuff, > called common/gdb_termios.h. That's be similar in spirit > to gdb/gdb_curses.h. That should only then be included > in files that actually need to see those bits defined. > Maybe job-control.c and inflow.c and not much else. > > The "#include " include should probably not be > in the resulting gdb_termios.h. I can't see why it's there > in your common-terminal.h. > > And then add a new common/job-control.h header that matches the > new job-control.c file, that _only_ exports job-control.c's > public interface, like, these three declarations: > > extern int job_control; > extern int gdb_setpgid (); > extern void have_job_control (); Thanks, it makes sense to separate like this, indeed. > Also, it looks like gdbserver's terminal.h has all the same > termios goo that you were putting in common-terminal.h. > We should remove/undup all that. Yeah, after a closer look I noticed that the code is just a simplified version of what's already done on the GDB side (now under common/). So I went ahead and deleted the gdbserver file. Thanks for this review, I implemented everything you mentioned on this message but will wait until you review the other parts before I send the v6. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/