From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42147 invoked by alias); 23 Mar 2015 23:04:59 -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 42131 invoked by uid 89); 23 Mar 2015 23:04:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 23 Mar 2015 23:04:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9F957D3637; Mon, 23 Mar 2015 19:04:53 -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 5X3jesjnQZKZ; Mon, 23 Mar 2015 19:04:53 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7449FD362C; Mon, 23 Mar 2015 19:04:53 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 06C7540EAD; Mon, 23 Mar 2015 16:04:52 -0700 (PDT) Date: Mon, 23 Mar 2015 23:04:00 -0000 From: Joel Brobecker To: James Bowman Cc: "gdb-patches@sourceware.org" Subject: Re: [PATCH, FT32] gdb and sim support Message-ID: <20150323230451.GK5438@adacore.com> References: <20150317173615.GC7494@adacore.com> <20150319185452.GA14215@vapier> <20150320124600.GA5273@adacore.com> <20150320154715.GI11803@vapier> <20150320155053.GB5273@adacore.com> <20150323023255.GA8039@vapier> <20150323123647.GB5438@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-03/txt/msg00761.txt.bz2 On Mon, Mar 23, 2015 at 07:15:32PM +0000, James Bowman wrote: > > > Oy! I didn't realize that the definitions were duplicated. Yes, indeed, > > let's make sure the sim and gdb both use the same defines. > > OK, all done. I have updated the patch for your review. sim-ft32.h is > still part of gdb, and the sim uses its definitions for the register > read interface. OK - If prefer to do it this way, then you will need to merge the GDB and sim part into the same patch. This is because you can't commit the GDB part without the sim (because of the configure bit that pulls in libsim.a), and you can't commit the sim part first, because it depends on sim-ft32.h which is brought in by the GDB part. That's why I thought it would make better sense for this file to be part of the sim patch, but if both patches get approved, and you merge them before pushing them, then I'm happy. > gdb/: > 2015-03-23 James Bowman > > * Makefile.in (ALL_TARGET_OBS): Add ft32-tdep.o. > (HFILES_NO_SRCDIR): Add ft32-tdep.h. > (ALLDEPFILES): Add ft32-tdep.c. > * configure.tgt: Add FT32 entry. > * ft32-tdep.c: New file, FT32 target-dependent code. > * ft32-tdep.h: New file, FT32 target-dependent code. > > include/gdb/: > 2015-03-23 James Bowman > > * sim-ft32.h: New file, FT32 simulator/GDB interface. This part of the submission is pre-approved, with a couple of very minor comments below. When you do push to sourceware.org, would you mind sending a copy of the patch that actually got pushed? (standard protocol for all patches, for our records on this mailing-list) (if you need write-after-approval access to the repository, please send me an email privately) Thank you, -- Joel > +static void > +ft32_store_return_value (struct type *type, struct regcache *regcache, > + const gdb_byte *valbuf) > +{ > + struct gdbarch *gdbarch = get_regcache_arch (regcache); > + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > + CORE_ADDR regval; > + int len = TYPE_LENGTH (type); > + > + /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */ > + regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order); > + regcache_cooked_write_unsigned (regcache, FT32_R0_REGNUM, regval); > + if (len > 4) > + { > + regval = extract_unsigned_integer (valbuf + 4, > + len - 4, byte_order); You don't have to change it if you prefer it this way, but I think you can join those 2 lines, now. > + /* Don't use line number debug info for assembly source files. */ > + if ((sym != NULL) && SYMBOL_LANGUAGE (sym) != language_asm) You don't need the parentheses around "sym != NULL". -- Joel