From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16237 invoked by alias); 14 Oct 2009 04:56:15 -0000 Received: (qmail 16223 invoked by uid 22791); 14 Oct 2009 04:56:13 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Oct 2009 04:56:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 470A42BABAF; Wed, 14 Oct 2009 00:56:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Hq4daeuk9FGm; Wed, 14 Oct 2009 00:56:08 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F0B952BAB07; Wed, 14 Oct 2009 00:56:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 60D61F58A0; Tue, 13 Oct 2009 21:55:58 -0700 (PDT) Date: Wed, 14 Oct 2009 04:56:00 -0000 From: Joel Brobecker To: Andrew Stubbs Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH][SH] Implement core-file support for sh-linux Message-ID: <20091014045558.GT5272@adacore.com> References: <4AD33C69.2070301@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AD33C69.2070301@codesourcery.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-10/txt/msg00299.txt.bz2 > 2009-10-12 Andrew Stubbs > > * configure.tgt (sh*-*-linux*): Add corelow.o to gdb_target_obs. > * sh-linux-tdep.c: Include gdb_assert.h, gdb_string.h, regcache.h, > regset.h and sh-tdep.h. > (struct sh_linux_pt_regs, struct sh_linux_user_fpu_struct): New types. > (sh_linux_supply_gregset, sh_linux_collect_gregset): New functions. > (sh_linux_supply_fpregset, sh_linux_collect_fpregset): New functions. > (sh_linux_gregset, sh_linux_fpregset): New variables. > (sh_linux_regset_from_core_section): New function. > (sh_linux_init_abi): Call set_gdbarch_regset_from_core_section. It seems a shame that this code is almost a complete duplication of the code in shnbsd. I think we can avoid that simply by having an array in the SH tdep structure that provides the offsets to the various registers, indexed by register number. Then the code from shnbsd can be moved to sh-tdep.c and the only remaining bit is to initialize the array appropriately in shbnsd-tdep and sh-linux-tdep. -- Joel