From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4632 invoked by alias); 2 May 2018 23:59:10 -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 4612 invoked by uid 89); 2 May 2018 23:59:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 May 2018 23:59:08 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30FF44270948 for ; Wed, 2 May 2018 23:59:07 +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 D445C1117653 for ; Wed, 2 May 2018 23:59:06 +0000 (UTC) Subject: Re: [PATCH] Make inf_ptrace_trad Linux-only, move to separate file To: gdb-patches@sourceware.org References: <20180412174722.32321-1-palves@redhat.com> From: Pedro Alves Message-ID: <558a9451-c3fd-b892-11aa-61aaefd2b0e8@redhat.com> Date: Wed, 02 May 2018 23:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180412174722.32321-1-palves@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00030.txt.bz2 On 04/12/2018 06:47 PM, Pedro Alves wrote: > There are only two inf_ptrace_trad_target users, MIPS GNU/Linux and > Alpha GNU/Linux. They both call it via linux_trad_target. > > Move this code out of inf-ptrace.c to a GNU/Linux-specific new file. > > Making this code be GNU/Linux-specific simplifies C++ification of > target_ops, because we can make the trad target inherit linux_nat > instead of inheriting inf_ptrace. That'll be visible in a later patch. > > Note this makes linux_target_install_ops an extern function, but that > is temporary -- the function will disappear once target_ops is made a > C++ class with virtual methods, later in the series. Also, I did not > rename the functions in the new file for a similar reason. They'll be > renamed again anyway in a couple of patches. > > gdb/ChangeLog: > yyyy-mm-dd Pedro Alves > > * alpha-linux-nat.c: Include "linux-nat-trad.h" instead of > "linux-nat.h". > * configure.nat (alpha-linux, linux-mips): Add linux-nat-trad.o. > * inf-ptrace.c (inf_ptrace_register_u_offset) > (inf_ptrace_fetch_register, inf_ptrace_fetch_registers) > (inf_ptrace_store_register, inf_ptrace_store_registers) > (inf_ptrace_trad_target): Move to ... > * linux-nat-trad.c: ... this new file. > * linux-nat-trad.h: New file. > * linux-nat.c (linux_target_install_ops): Make extern. > (linux_trad_target): Delete. > * linux-nat.h (linux_trad_target): Delete declaration. > (linux_target_install_ops): Declare. > * mips-linux-nat.c: Include "linux-nat-trad.h" instead of > "linux-nat.h". Pushed. Thanks, Pedro Alves