From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11664 invoked by alias); 30 May 2013 12:15:40 -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 11619 invoked by uid 89); 30 May 2013 12:15:40 -0000 X-Spam-SWARE-Status: No, score=-8.1 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_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:40 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4UCFciB013465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 May 2013 08:15:38 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4UCFbOd031538 for ; Thu, 30 May 2013 08:15:37 -0400 Subject: [PATCH 17/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Aarch64 To: gdb-patches@sourceware.org From: Pedro Alves Date: Thu, 30 May 2013 12:15:00 -0000 Message-ID: <20130530121536.15047.69398.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/msg01074.txt.bz2 This adjusts the GNU/Linux Aarch64 port to new interfaces. Buit with a cross aarch64-linux-gnu toolchain. Otherwise not tested. 2012-05-30 Pedro Alves * linux-aarch64-low.c (tdesc_aarch64): Declare. (aarch64_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (aarch64_regsets): ... this. (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals. (aarch64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. --- gdb/gdbserver/linux-aarch64-low.c | 43 +++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index cdf9cfd..e37f602 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -32,6 +32,7 @@ /* Defined in auto-generated files. */ void init_registers_aarch64 (void); +extern const struct target_desc *tdesc_aarch64; #ifdef HAVE_SYS_REG_H #include @@ -1188,7 +1189,7 @@ aarch64_arch_setup (void) struct iovec iov; struct user_hwdebug_state dreg_state; - init_registers_aarch64 (); + current_process ()->tdesc = tdesc_aarch64; pid = lwpid_of (get_thread_lwp (current_inferior)); iov.iov_base = &dreg_state; @@ -1235,7 +1236,7 @@ aarch64_arch_setup (void) } } -struct regset_info target_regsets[] = +static struct regset_info aarch64_regsets[] = { { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS, sizeof (struct user_pt_regs), GENERAL_REGS, @@ -1247,12 +1248,36 @@ struct regset_info target_regsets[] = { 0, 0, 0, -1, -1, NULL, NULL } }; +static struct regsets_info aarch64_regsets_info = + { + aarch64_regsets, /* regsets */ + 0, /* num_regsets */ + NULL, /* disabled_regsets */ + }; + +static struct usrregs_info aarch64_usrregs_info = + { + AARCH64_NUM_REGS, + aarch64_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &aarch64_usrregs_info, + &aarch64_regsets_info, + }; + +static const struct regs_info * +aarch64_regs_info (void) +{ + return ®s_info; +} + struct linux_target_ops the_low_target = { aarch64_arch_setup, - AARCH64_NUM_REGS, - aarch64_regmap, - NULL, + aarch64_regs_info, aarch64_cannot_fetch_register, aarch64_cannot_store_register, NULL, @@ -1274,3 +1299,11 @@ struct linux_target_ops the_low_target = aarch64_linux_new_thread, aarch64_linux_prepare_to_resume, }; + +void +initialize_low_arch (void) +{ + init_registers_aarch64 (); + + initialize_regsets_info (&aarch64_regsets_info); +}