From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8427 invoked by alias); 30 May 2013 12:15:05 -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 8399 invoked by uid 89); 30 May 2013 12:15:05 -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; Thu, 30 May 2013 12:15:04 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4UCF392013146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 May 2013 08:15:03 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4UCF2cw005564 for ; Thu, 30 May 2013 08:15:03 -0400 Subject: [PATCH 12/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRISv32 To: gdb-patches@sourceware.org From: Pedro Alves Date: Thu, 30 May 2013 12:15:00 -0000 Message-ID: <20130530121502.15047.9613.stgit@brno.lan> In-Reply-To: <20130530121335.15047.12654.stgit@brno.lan> References: <20130530121335.15047.12654.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/msg01069.txt.bz2 This adjusts the GNU/Linux CRISv32 port to new interfaces. Completely untested. 2013-05-30 Pedro Alves * linux-cris-low.c (tdesc_crisv32): Declare. (cris_arch_setup): New function. (cris_regsets_info, cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. --- gdb/gdbserver/linux-crisv32-low.c | 52 +++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c index ca0e276..efe50a7 100644 --- a/gdb/gdbserver/linux-crisv32-low.c +++ b/gdb/gdbserver/linux-crisv32-low.c @@ -22,6 +22,7 @@ /* Defined in auto-generated file reg-crisv32.c. */ void init_registers_crisv32 (void); +extern const struct target_desc *tdesc_crisv32; /* CRISv32 */ #define cris_num_regs 49 @@ -362,17 +363,50 @@ cris_store_gregset (struct regcache *regcache, const void *buf) } } -struct regset_info target_regsets[] = { +static void +cris_arch_setup (void) +{ + current_process ()->tdesc = tdesc_crisv32; +} + +typedef unsigned long elf_gregset_t[cris_num_regs]; + +static struct regset_info cris_regsets[] = { { PTRACE_GETREGS, PTRACE_SETREGS, 0, cris_num_regs * 4, GENERAL_REGS, cris_fill_gregset, cris_store_gregset }, { 0, 0, 0, -1, -1, NULL, NULL } }; + +static struct regsets_info cris_regsets_info = + { + cris_regsets, /* regsets */ + 0, /* num_regsets */ + NULL, /* disabled_regsets */ + }; + +static struct usrregs_info cris_usrregs_info = + { + cris_num_regs, + cris_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &cris_usrregs_info, + &cris_regsets_info + }; + +static const struct regs_info * +cris_regs_info (void) +{ + return ®s_info; +} + struct linux_target_ops the_low_target = { - init_registers_crisv32, - -1, - NULL, - NULL, + cris_arch_setup, + cris_regs_info, NULL, NULL, NULL, /* fetch_register */ @@ -388,3 +422,11 @@ struct linux_target_ops the_low_target = { cris_stopped_by_watchpoint, cris_stopped_data_address, }; + +void +initialize_low_arch (void) +{ + init_register_crisv32 (); + + initialize_regsets_info (&cris_regsets_info); +}