From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4085 invoked by alias); 31 Jul 2013 18:43:48 -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 4076 invoked by uid 89); 31 Jul 2013 18:43:48 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_40,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 18:43:47 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V4bN5-0007cy-Er from Luis_Gustavo@mentor.com ; Wed, 31 Jul 2013 11:43:39 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 31 Jul 2013 11:43:39 -0700 Received: from [172.30.1.227] ([172.30.1.227]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 31 Jul 2013 11:43:38 -0700 Message-ID: <51F95AD5.9050200@codesourcery.com> Date: Wed, 31 Jul 2013 18:43:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pedro Alves CC: "'gdb-patches@sourceware.org'" , Tom Tromey Subject: Re: [PATCH] Share more common target structures between gdb and gdbserver References: <51E595A0.6090500@codesourcery.com> <51F7FC4E.3050604@redhat.com> In-Reply-To: <51F7FC4E.3050604@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00838.txt.bz2 On 07/30/2013 02:47 PM, Pedro Alves wrote: > On 07/16/2013 07:49 PM, Luis Machado wrote: >> Hi, >> >> While doing some research about the remote fork following feature, i >> noticed there was some duplication of target data structures for GDB and >> gdbserver. >> >> This patch moves the shareable code/data structures to >> common/target-common.* and makes both GDB and gdbserver target files >> reference the header common/target-common.h. >> >> Makefiles and other files have been adjusted accordingly. > > I'd very much prefer avoiding "common" in file names, instead > naming the files for what they contain, not for the fact that they're > "common" to two programs (gdb, gdbserver) presently. I think of it > this way -- when we finally end up with only one backend (or one > backend using a foo-common.c file), I'd rather avoid > renaming these files to something else, because they're no longer > "common". Or, yet IOW, think of common/ as a library. Can you > imagine if all libraries in a distro named their implementation > files "foo-common.c" ? Because that's what should happen given > they're used by lots of programs, right? :-) The direction I prefer > is, when moving things to common/ we take the opportunity to split them > into smaller, more atomic, leaner units. E.g., that's how we ended up > with ptid.h/ptid.c, instead of inferior-common.h (or some such). It makes sense to me, though i think we may have to think about creating directories of subsystems instead of laying files the old way in a flat directory structure. We still have a handful of files in common, so maybe it is a good starting point for that. > If the file is just a dumping ground of misc things, then let's at > least call it that. Say, target-misc.h or target-defs.h. I'll declare them target-defs.h and target-misc.h/target-misc.c. How does that sound? > > Otherwise, this looks good to me. > > On 07/16/2013 07:49 PM, Luis Machado wrote: >> +++ b/gdb/common/target-common.h >> @@ -0,0 +1,153 @@ >> +/* Interface between the debugger and target environments, including files >> + and processes, shared between GDB and gdbserver. >> + >> + Copyright (C) 1990-2013 Free Software Foundation, Inc. >> + >> + Contributed by Cygnus Support. Written by John Gilmore. > > (I have absolutely nothing again John, but this shows how > "contributed by"/"written by" lines are a disservice to future > hackers, IMO. Lot's of code here that others wrote.) > Not wanting to offend John, but should i just remove this line in the upcoming patch?