From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1872 invoked by alias); 30 May 2013 12:13:56 -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 1850 invoked by uid 89); 30 May 2013 12:13:56 -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:13:54 +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 r4UCDrPt002618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 May 2013 08:13:53 -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 r4UCDpUp008296 for ; Thu, 30 May 2013 08:13:52 -0400 Subject: [PATCH 02/22] [GDBserver] Multi-process + multi-arch: GNU/Linux IA64 To: gdb-patches@sourceware.org From: Pedro Alves Date: Thu, 30 May 2013 12:14:00 -0000 Message-ID: <20130530121351.15047.63487.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/msg01060.txt.bz2 This adjusts the GNU/Linux IA64 port to new interfaces. Previously tested on ia64-unknown-linux-gnu, local gdbserver. 2013-05-30 Pedro Alves * linux-ia64-low.c (tdesc_ia64): Declare. (ia64_fetch_register): Adjust. (ia64_usrregs_info, regs_info): New globals. (ia64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. --- gdb/gdbserver/linux-ia64-low.c | 44 ++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c index deedb21..8cd2da4 100644 --- a/gdb/gdbserver/linux-ia64-low.c +++ b/gdb/gdbserver/linux-ia64-low.c @@ -25,6 +25,7 @@ /* Defined in auto-generated file reg-ia64.c. */ void init_registers_ia64 (void); +extern const struct target_desc *tdesc_ia64; #define ia64_num_regs 462 @@ -290,7 +291,7 @@ ia64_fetch_register (struct regcache *regcache, int regnum) { const gdb_byte zero[8] = { 0 }; - gdb_assert (sizeof (zero) == register_size (regnum)); + gdb_assert (sizeof (zero) == register_size (regcache->tdesc, regnum)); supply_register (regcache, regnum, zero); return 1; } @@ -300,7 +301,7 @@ ia64_fetch_register (struct regcache *regcache, int regnum) { const gdb_byte f_zero[16] = { 0 }; - gdb_assert (sizeof (f_zero) == register_size (regnum)); + gdb_assert (sizeof (f_zero) == register_size (regcache->tdesc, regnum)); supply_register (regcache, regnum, f_zero); return 1; } @@ -311,7 +312,7 @@ ia64_fetch_register (struct regcache *regcache, int regnum) const gdb_byte f_one[16] = { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 }; - gdb_assert (sizeof (f_one) == register_size (regnum)); + gdb_assert (sizeof (f_one) == register_size (regcache->tdesc, regnum)); supply_register (regcache, regnum, f_one); return 1; } @@ -319,12 +320,41 @@ ia64_fetch_register (struct regcache *regcache, int regnum) return 0; } +static struct usrregs_info ia64_usrregs_info = + { + ia64_num_regs, + ia64_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &ia64_usrregs_info + }; + +static const struct regs_info * +ia64_regs_info (void) +{ + return ®s_info; +} + +static void +ia64_arch_setup (void) +{ + current_process ()->tdesc = tdesc_ia64; +} + + struct linux_target_ops the_low_target = { - init_registers_ia64, - ia64_num_regs, - ia64_regmap, - NULL, + ia64_arch_setup, + ia64_regs_info, ia64_cannot_fetch_register, ia64_cannot_store_register, ia64_fetch_register, }; + +void +initialize_low_arch (void) +{ + init_registers_ia64 (); +}