This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, FT32] gdb and sim support


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  <james.bowman@ftdichip.com>
> 
> 	* 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  <james.bowman@ftdichip.com>
> 
> 	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]