From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107722 invoked by alias); 31 Mar 2017 18:21:32 -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 107696 invoked by uid 89); 31 Mar 2017 18:21:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1880 X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Mar 2017 18:21:30 +0000 Received: by mail-wm0-f41.google.com with SMTP id t189so5351623wmt.1 for ; Fri, 31 Mar 2017 11:21:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=IJYgRQJHsz42pVrdUbEhErFsYUPIEBUdLtJrn6uoCi4=; b=oRqYXg3IK5/HOnm24lCFtJB/iWM6g5LrxtHuMKskkC9P6HL7E+MwaB6Fe1ReREDpmu 5cnhVR+wm7oScQpji1TXE4m4QeY0hzCBrORVGfrbFg9nynInswyvknoMwThS9lyx8eRI TjotXj3exHqTpDt8N3IWMp9yUZ1jo5EbtJGTwJaG8oUouvOAqnoMgJpF5hsL00y+BXM0 DFkRGbXRI2zNmhqRj/aSnJ0yS51JDUmH1yf1WODzfZvimNDLUOHT5BA3JWP7xDu6ZuMX 1u+5/+Oo2YRiPB5RN1d+2eZDsNoJYBBcfqf1dGPcI9dV2sTDsGUdKkG5Q4MNqsbhb6VO 0kqQ== X-Gm-Message-State: AFeK/H014HNmb2h1MRtMM3TV8n5YVEdIJT0pw0pR7+xcyubRLv5INedDh0j6z4601Y5jceLy X-Received: by 10.28.54.215 with SMTP id y84mr4601328wmh.90.1490984489716; Fri, 31 Mar 2017 11:21:29 -0700 (PDT) Received: from [192.168.0.101] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id 204sm3813201wmw.0.2017.03.31.11.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 11:21:28 -0700 (PDT) Subject: Re: [PATCH v5 1/5] Move parts of inferior job control to common/ To: Sergio Durigan Junior 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> Cc: GDB Patches From: Pedro Alves Message-ID: Date: Fri, 31 Mar 2017 18:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87a881tksh.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00553.txt.bz2 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 (); 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. Thanks, Pedro Alves