This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, FT32] gdb and sim support
- From: Joel Brobecker <brobecker at adacore dot com>
- To: James Bowman <james dot bowman at ftdichip dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 23 Mar 2015 16:04:51 -0700
- Subject: Re: [PATCH, FT32] gdb and sim support
- Authentication-results: sourceware.org; auth=none
- References: <20150317173615 dot GC7494 at adacore dot com> <CA9BBF0458F83C4F9051448B941B57D117232A0A at glaexch1> <20150319185452 dot GA14215 at vapier> <CA9BBF0458F83C4F9051448B941B57D117234A61 at glaexch1> <20150320124600 dot GA5273 at adacore dot com> <20150320154715 dot GI11803 at vapier> <20150320155053 dot GB5273 at adacore dot com> <20150323023255 dot GA8039 at vapier> <20150323123647 dot GB5438 at adacore dot com> <CA9BBF0458F83C4F9051448B941B57D117234ACB at glaexch1>
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
- References:
- Re: [PATCH, FT32] gdb and sim support
- RE: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- RE: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- Re: [PATCH, FT32] gdb and sim support
- RE: [PATCH, FT32] gdb and sim support