From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8455 invoked by alias); 25 Sep 2003 19:44:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8425 invoked from network); 25 Sep 2003 19:44:02 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 25 Sep 2003 19:44:02 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8PJi2103889 for ; Thu, 25 Sep 2003 15:44:02 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8PJi1c21842 for ; Thu, 25 Sep 2003 15:44:01 -0400 Received: from localhost.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h8PJi1TX002352 for ; Thu, 25 Sep 2003 15:44:01 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 432502CCA3; Thu, 25 Sep 2003 15:53:45 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16243.18376.371969.84204@localhost.redhat.com> Date: Thu, 25 Sep 2003 19:44:00 -0000 To: gdb-patches@sources.redhat.com Subject: Re: SH patch 2 (was Re: [RFA] SH: Deprecate deprecated functions, use new frame interface) In-Reply-To: <20030924112808.GI9981@cygbert.vinschen.de> References: <16226.1322.230352.450541@localhost.redhat.com> <20030915160111.GA9283@cygbert.vinschen.de> <16231.17730.828347.741094@localhost.redhat.com> <20030916172606.GU9981@cygbert.vinschen.de> <20030916173038.GA25459@nevyn.them.org> <20030922143254.GR9981@cygbert.vinschen.de> <20030922144405.GA20343@nevyn.them.org> <20030922150831.GA17905@cygbert.vinschen.de> <16240.44135.87461.106684@localhost.redhat.com> <20030924084311.GF9981@cygbert.vinschen.de> <20030924112808.GI9981@cygbert.vinschen.de> X-SW-Source: 2003-09/txt/msg00572.txt.bz2 Corinna Vinschen writes: > On Wed, Sep 24, 2003 at 10:43:11AM +0200, Corinna Vinschen wrote: > > On Tue, Sep 23, 2003 at 04:26:15PM -0400, Elena Zannoni wrote: > > > I think so too. But I'd like to see if something can be done for SH > > > similar to the i386_convert_register_p method. > > > > Is that necessary before the patch gets approval or could that be added > > in a follow up step? > > I've tested the below patch and the effect is absolut zero with respect to > the store.exp results. What am I doing wrong? It doesn't matter if I > diable the dwarf2 sniffer or not, btw. > Did you try to find out where things go wrong? > Corinna > > --- sh-tdep.c.NEW 2003-09-24 12:24:10.000000000 +0200 > +++ sh-tdep.c 2003-09-24 13:25:30.000000000 +0200 > @@ -2111,6 +2111,58 @@ sh_in_function_epilogue_p (struct gdbarc > return 0; > } > > +/* Return nonzero if a value of type TYPE stored in register REGNUM > + needs any special handling. */ > +static int > +sh_convert_register_p (int regnum, struct type *type) > +{ > + if (TYPE_CODE (type) == TYPE_CODE_FLT) > + return TYPE_LENGTH (type) > 4 && regnum < DR0_REGNUM; > + return TYPE_LENGTH (type) > 4; > +} > + > +/* Read a value of type TYPE from register REGNUM in frame FRAME, and > + return its contents in TO. */ > +static void > +sh_register_to_value (struct frame_info *frame, int regnum, > + struct type *type, void *to) > +{ > + int len = TYPE_LENGTH (type); > + char *buf = to; > + > + while (len > 0) > + { > + get_frame_register (frame, regnum++, buf); > + if (regnum == 16) /* Normal register overflow */ > + break; > + if (regnum == 41) /* FP register overflow */ > + break; > + len -= 4; > + buf += 4; > + } > +} > + > +/* Write the contents FROM of a value of type TYPE into register > + REGNUM in frame FRAME. */ > +static void > +sh_value_to_register (struct frame_info *frame, int regnum, > + struct type *type, const void *from) > +{ > + int len = TYPE_LENGTH (type); > + const char *buf = from; > + > + while (len > 0) > + { > + put_frame_register (frame, regnum, buf); > + if (regnum == 16) /* Normal register overflow */ > + break; > + if (regnum == 41) /* FP register overflow */ > + break; > + len -= 4; > + buf += 4; > + } > +} > + > static gdbarch_init_ftype sh_gdbarch_init; > > static struct gdbarch * > @@ -2213,6 +2265,10 @@ sh_gdbarch_init (struct gdbarch_info inf > set_gdbarch_in_function_epilogue_p (gdbarch, > sh_in_function_epilogue_p); > > + set_gdbarch_convert_register_p (gdbarch, sh_convert_register_p); > + set_gdbarch_register_to_value (gdbarch, sh_register_to_value); > + set_gdbarch_value_to_register (gdbarch, sh_value_to_register); > + > switch (info.bfd_arch_info->mach) > { > case bfd_mach_sh: > > -- > Corinna Vinschen > Cygwin Developer > Red Hat, Inc.