From patchwork Thu May 11 15:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 20408 Received: (qmail 96166 invoked by alias); 11 May 2017 15:55:12 -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 94691 invoked by uid 89); 11 May 2017 15:55:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f178.google.com Received: from mail-pf0-f178.google.com (HELO mail-pf0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 May 2017 15:55:09 +0000 Received: by mail-pf0-f178.google.com with SMTP id m17so15861526pfg.3 for ; Thu, 11 May 2017 08:55:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=afM6RPufW8XfGQYCCOT8DIv2GaQ3Tc3dcQFkGTrE1Ls=; b=TwdJdAzod7tPBSl4N9cAID4rlKUbxxECF6vnTxKeapqRc+WhDRp+BrmQT+ywfz8vNk +erG75i1a9ltmPxgH0GqDaVi9Vv2J9WhoT/o1oDCiobT9xUvEW+KXnDYKPav8qA4wBbZ r9aKKxTEU5s8it65sZrGk+zQVkbvtP386DqjiRDhcAYRNCGOG75ZCaQ0+lkXoX09+yrc BUn4ZkYddQ0U8NsnHeOFf1/04SIAMtpENjSkJ9siHp19vej3ynLlxFD9stGGDGQkpD8h RDLec+aZaLNXfgTgUx8jdbyTbQig0tTZF0+p4jSZ37A4WosmtSu1hZ4jghzSlhrp8fZg Ms3Q== X-Gm-Message-State: AODbwcDm1iMVwD+xkQyq890yHkTWbP1uzQerQRzTxve1ndXwHLlepJhX QrnocLQsnqHWVYjw X-Received: by 10.99.109.130 with SMTP id i124mr1080889pgc.117.1494518110205; Thu, 11 May 2017 08:55:10 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id f27sm1021158pga.41.2017.05.11.08.55.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 08:55:09 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [RFC 1/7] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Date: Thu, 11 May 2017 16:54:59 +0100 Message-Id: <1494518105-15412-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1494518105-15412-1-git-send-email-yao.qi@linaro.org> References: <1494518105-15412-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Target description initialization are called in -tdep.c, instead of -nat.c I've posted it separately https://sourceware.org/ml/gdb-patches/2017-05/msg00204.html, include it here to give more context. gdb: 2017-05-09 Yao Qi * mips-linux-nat.c: Move include features/mips*-linux.c to mips-linux-tdep.c. (_initialize_mips_linux_nat): Move initialize_tdesc_mips* calls to mips-linux-tdep.c. * mips-linux-tdep.c: Include features/mips*-linux.c (_initialize_mips_linux_tdep): Call initialize_tdesc_mips* functions. * mips-linux-tdep.h (tdesc_mips_linux): Declare. (tdesc_mips_dsp_linux, tdesc_mips64_linux): Declare. (tdesc_mips64_dsp_linux): Declare. --- gdb/mips-linux-nat.c | 11 ----------- gdb/mips-linux-tdep.c | 11 +++++++++++ gdb/mips-linux-tdep.h | 6 ++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index 8041d84..1fd3365 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -38,11 +38,6 @@ #include "nat/mips-linux-watch.h" -#include "features/mips-linux.c" -#include "features/mips-dsp-linux.c" -#include "features/mips64-linux.c" -#include "features/mips64-dsp-linux.c" - #ifndef PTRACE_GET_THREAD_AREA #define PTRACE_GET_THREAD_AREA 25 #endif @@ -803,10 +798,4 @@ triggers a breakpoint or watchpoint."), linux_nat_add_target (t); linux_nat_set_new_thread (t, mips_linux_new_thread); - - /* Initialize the standard target descriptions. */ - initialize_tdesc_mips_linux (); - initialize_tdesc_mips_dsp_linux (); - initialize_tdesc_mips64_linux (); - initialize_tdesc_mips64_dsp_linux (); } diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 48a582a..0f22a92 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -40,6 +40,11 @@ #include "xml-syscall.h" #include "gdb_signals.h" +#include "features/mips-linux.c" +#include "features/mips-dsp-linux.c" +#include "features/mips64-linux.c" +#include "features/mips64-dsp-linux.c" + static struct target_so_ops mips_svr4_so_ops; /* This enum represents the signals' numbers on the MIPS @@ -1764,4 +1769,10 @@ _initialize_mips_linux_tdep (void) GDB_OSABI_LINUX, mips_linux_init_abi); } + + /* Initialize the standard target descriptions. */ + initialize_tdesc_mips_linux (); + initialize_tdesc_mips_dsp_linux (); + initialize_tdesc_mips64_linux (); + initialize_tdesc_mips64_dsp_linux (); } diff --git a/gdb/mips-linux-tdep.h b/gdb/mips-linux-tdep.h index 407b577..cca4798 100644 --- a/gdb/mips-linux-tdep.h +++ b/gdb/mips-linux-tdep.h @@ -105,3 +105,9 @@ enum { /* Return 1 if MIPS_RESTART_REGNUM is usable. */ int mips_linux_restart_reg_p (struct gdbarch *gdbarch); + +/* Target descriptions. */ +extern struct target_desc *tdesc_mips_linux; +extern struct target_desc *tdesc_mips64_linux; +extern struct target_desc *tdesc_mips_dsp_linux; +extern struct target_desc *tdesc_mips64_dsp_linux;