From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17768 invoked by alias); 25 May 2012 15:17:44 -0000 Received: (qmail 17753 invoked by uid 22791); 25 May 2012 15:17:41 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 15:17:17 +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 q4PFH4tL004557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 May 2012 11:17:04 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4PFH3CB031582; Fri, 25 May 2012 11:17:03 -0400 Message-ID: <4FBFA26F.20002@redhat.com> Date: Fri, 25 May 2012 15:17:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Jeff Kenton CC: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: [PATCH] Add support for Tilera TILE-Gx processor (part 1/3: gdb) References: <4FAD39A1.1000209@tilera.com> <20120514162046.GI10253@adacore.com> <4FBA4FD2.9090108@tilera.com> <4FBD1F67.9090609@redhat.com> <4FBE8B5E.6050800@tilera.com> In-Reply-To: <4FBE8B5E.6050800@tilera.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-05/txt/msg00970.txt.bz2 On 05/24/2012 08:26 PM, Jeff Kenton wrote: > On 05/23/2012 01:33 PM, Pedro Alves wrote: >> Hi Jeff, >> >> On 05/21/2012 03:23 PM, Jeff Kenton wrote: >> >> > > - Comments applied. > - SIGTRAMP frame handling improved. > - Patch attached. For the future, it's easier for the reviewer if you reply to the issues and questions raised. For example, in patch 2, I'm left wondering if the ps_get_thread_area addition fixed any testsuite failures, indicating it is correct. I'm also left wondering what does "improved" mean (probably fixed something in the testsuite?). > diff -r -u -N /home/packages/gdb-7.4x/gdb/tilegx-linux-tdep.c ./gdb/tilegx-linux-tdep.c > --- /home/packages/gdb-7.4x/gdb/tilegx-linux-tdep.c 1969-12-31 19:00:00.000000000 -0500 > +++ ./gdb/tilegx-linux-tdep.c 2012-05-24 13:43:30.089276000 -0400 > +/* Supply raw registers from REGCACHE to REGS. */ > + > +/* TILE-Gx has 56 general purpose registers, > + plus 8 special general purpose registers (network and ZERO), > + plus 1 magic register (PC == 64). > + We only need the following 2 enums here. */ > + > +enum { > + E_NUM_EASY_REGS = 56, > + E_PC_REGNUM = 64 > +}; > + > +enum { tilegx_reg_size = 8 }; I didn't pay close attention to what these two enums were before. The standard thing to do instead of defining tilegx_reg_size twice, and hacking up that short enum for the register numbers, is to move the register numbers enum from tilegx-tdep.c to and tilegx-tdep.h file, and include that where necessary, so we only have one place with the register numbers. 'E_' isn't a great prefix (does it mean 'enum'?), so please replace it with something like TILEGX_PC_REGNUM, etc. along with the move. > +/* OS specific initialization of gdbarch. */ > + > +static void > +tilegx_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) > +{ > + int arch_size = 64; > + > + /* Handle arch_size == 32 or 64. Default to 64. */ > + if (info.abfd) > + arch_size = bfd_get_arch_size (info.abfd); > + > + if (arch_size != 32) > + arch_size = 64; Why is this 'if' necessary? Does bfd_get_arch_size ever return anything not 32 or 64? In any case, you can just use gdbarch_addr_bit here, as tilegx_gdbarch_init has already done the similar bfd_get_arch_size bit. > +/* This is the implementation of gdbarch method breakpoint_from_pc. */ > + > +static const unsigned char * > +tilegx_breakpoint_from_pc (struct gdbarch *gdbarch, > + CORE_ADDR *pcptr, int *lenptr) > +{ > + /* 64-bit pattern for a { bpt ; nop } bundle. */ > + static unsigned char breakpoint[] = static const. > + { 0x00, 0x50, 0x48, 0x51, 0xae, 0x44, 0x6a, 0x28 }; > + > + *lenptr = sizeof (breakpoint); > + return breakpoint; > +} > + I think we're getting close. If Joel or anyone else has further comments, the next iteration should be about ready to go in. -- Pedro Alves