Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: Simon Marchi <simark@simark.ca>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	nd <nd@arm.com>
Subject: Re: [PATCH 3/7] Arm: Add read_description read funcs and use in GDB
Date: Wed, 10 Jul 2019 14:26:00 -0000	[thread overview]
Message-ID: <BA4B5205-854F-4A46-A5D7-E19F6BBB5C05@arm.com> (raw)
In-Reply-To: <6071A4B3-3D8F-4C63-88FA-0DA2AB506F1C@arm.com>



> On 10 Jul 2019, at 14:52, Alan Hayward <Alan.Hayward@arm.com> wrote:
> 
> 
> 
>> On 10 Jul 2019, at 04:45, Simon Marchi <simark@simark.ca> wrote:
>> 
>> On 2019-07-05 5:45 a.m., Alan Hayward wrote:
>>> 


>>> +
>>> +/* See arch/arm.h.  */
>>> +
>>> +target_desc *
>>> +arm_create_target_description (arm_fp_type fp_type)
>>> +{
>>> +  switch (fp_type)
>>> +    {
>>> +    case ARM_FP_TYPE_NONE:
>>> +      return nullptr;
>>> +
>>> +    case ARM_FP_TYPE_VFPV2:
>>> +      return tdesc_arm_with_vfpv2;
>>> +
>>> +    case ARM_FP_TYPE_VFPV3:
>>> +      return tdesc_arm_with_vfpv3;
>>> +
>>> +    case ARM_FP_TYPE_IWMMXT:
>>> +      return tdesc_arm_with_iwmmxt;
>>> +
>>> +    default:
>>> +      error (_("Invalid Arm FP type: %d"), fp_type);
>>> +    }
>>> +}
>>> +
>>> +/* See arch/arm.h.  */
>>> +
>>> +target_desc *
>>> +arm_create_mprofile_target_description (arm_m_profile_type m_type)
>>> +{
>>> +  switch (m_type)
>>> +    {
>>> +#ifndef GDBSERVER
>>> +    case ARM_M_TYPE_M_PROFILE:
>>> +      return tdesc_arm_with_m;
>>> +
>>> +    case ARM_M_TYPE_VFP_D16:
>>> +      return tdesc_arm_with_m_fpa_layout;
>>> +
>>> +    case ARM_M_TYPE_WITH_FPA:
>>> +      return tdesc_arm_with_m_vfp_d16;
>>> +#endif
>>> +    default:
>>> +      error (_("Invalid Arm M type: %d"), m_type);
>>> +    }
>>> +}
>> 
>> If it doesn't make sense to have this function shared with GDBserver (given
>> that GDBserver doesn't run on Cortex-Ms), it should probably go in gdb/arm-tdep.c.
> 
> Right. I wasn’t thinking of arch as “architecture code shared with gdbserver”,
> but it makes sense.
> 
> The GDBSERVER defines do vanish later in the series.
> 
> I think I preferred having the two functions together in arch, but I’ve moved it.
> 

To this, I’ll add that moving the mprofile function into arm-tdep.c means that
in a later patch, both arm-tdep.c and arch/arm.c have to 
#include "features/arm/arm-vfpv2.c”

This is because ARM_M_TYPE_VFP_D16 uses the vfpv2 functions.

It works, but means that the same static function is being included twice.


Alan.



  reply	other threads:[~2019-07-10 14:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05  9:46 [PATCH 0/7] Arm: Use feature target descriptions Alan Hayward
2019-07-05  9:45 ` [PATCH 3/7] Arm: Add read_description read funcs and use in GDB Alan Hayward
2019-07-10  3:45   ` Simon Marchi
2019-07-10 13:52     ` Alan Hayward
2019-07-10 14:26       ` Alan Hayward [this message]
2019-07-10 16:05         ` Simon Marchi
2019-07-10 16:07       ` Simon Marchi
2019-07-10 16:15         ` Alan Hayward
2019-07-05  9:45 ` [PATCH 4/7] Arm: Use feature target descriptions Alan Hayward
2019-07-05  9:46 ` [PATCH 1/7] Arm: Minor style cleanups Alan Hayward
2019-07-05  9:46 ` [PATCH 6/7] Arm: Use read_description funcs in gdbserver Alan Hayward
2019-07-10  4:04   ` Simon Marchi
2019-07-10 15:44     ` Alan Hayward
2019-07-05  9:46 ` [PATCH 5/7] Arm: Add xml unit tests Alan Hayward
2019-07-05  9:46 ` [PATCH 7/7] Arm: Remove unused feature files and tests Alan Hayward
2019-07-05  9:46 ` [PATCH 2/7] Arm: Create feature files for Arm target descriptions Alan Hayward
2019-07-10  2:56   ` Simon Marchi
2019-07-10 13:22     ` Alan Hayward

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BA4B5205-854F-4A46-A5D7-E19F6BBB5C05@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox