From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29770 invoked by alias); 29 May 2013 16:29:12 -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 29731 invoked by uid 89); 29 May 2013 16:29:11 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_EG,TW_SR autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 29 May 2013 16:29:10 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4TGT87m015821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 May 2013 12:29:08 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4TGT7OS010217 for ; Wed, 29 May 2013 12:29:07 -0400 Subject: [PATCH 16/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Nios 2 To: gdb-patches@sourceware.org From: Pedro Alves Date: Wed, 29 May 2013 16:29:00 -0000 Message-ID: <20130529162907.24586.4958.stgit@brno.lan> In-Reply-To: <20130529162434.24586.5697.stgit@brno.lan> References: <20130529162434.24586.5697.stgit@brno.lan> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg01017.txt.bz2 This adjusts the GNU/Linux Nios 2 port to new interfaces. Built with a cross nios2-linux-gnu toolchain. Otherwise not tested. gdb/gdbserver/ 2012-05-29 Pedro Alves * linux-nios2-low.c (tdesc_nios2_linux): Declare. (nios2_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (nios2_regsets): ... this. (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals. (nios2_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. --- gdb/gdbserver/linux-nios2-low.c | 43 ++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c index c41579f..0f1625a 100644 --- a/gdb/gdbserver/linux-nios2-low.c +++ b/gdb/gdbserver/linux-nios2-low.c @@ -40,6 +40,7 @@ /* Defined in auto-generated file nios2-linux.c. */ void init_registers_nios2_linux (void); +extern struct target_desc *tdesc_nios2_linux; /* This union is used to convert between int and byte buffer representations of register contents. */ @@ -68,7 +69,7 @@ static int nios2_regmap[] = { static void nios2_arch_setup (void) { - init_registers_nios2_linux (); + current_process ()->tdesc = tdesc_nios2_linux; } /* Implement the cannot_fetch_register linux_target_ops method. */ @@ -206,7 +207,7 @@ nios2_store_gregset (struct regcache *regcache, const void *buf) } #endif /* HAVE_PTRACE_GETREGS */ -struct regset_info target_regsets[] = +static struct regset_info nios2_regsets[] = { #ifdef HAVE_PTRACE_GETREGS { PTRACE_GETREGS, PTRACE_SETREGS, 0, nios2_num_regs * 4, GENERAL_REGS, @@ -215,12 +216,36 @@ struct regset_info target_regsets[] = { 0, 0, 0, -1, -1, NULL, NULL } }; +static struct regsets_info nios2_regsets_info = + { + nios2_regsets, /* regsets */ + 0, /* num_regsets */ + NULL, /* disabled_regsets */ + }; + +static struct usrregs_info nios2_usrregs_info = + { + nios2_num_regs, + nios2_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &nios2_usrregs_info, + &nios2_regsets_info + }; + +static const struct regs_info * +nios2_regs_info (void) +{ + return ®s_info; +} + struct linux_target_ops the_low_target = { nios2_arch_setup, - nios2_num_regs, - nios2_regmap, - NULL, + nios2_regs_info, nios2_cannot_fetch_register, nios2_cannot_store_register, NULL, @@ -232,3 +257,11 @@ struct linux_target_ops the_low_target = 0, nios2_breakpoint_at, }; + +void +initialize_low_arch (void) +{ + init_registers_nios2_linux (); + + initialize_regsets_info (&nios2_regsets_info); +}